Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 22nd, 2007, 03:57 PM
Authorized User
 
Join Date: Apr 2004
Location: LEOMINSTER, Herefordshire, United Kingdom.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default "The OpenForm command was canceled"

Run-time error no. 2501

I gather from searching this and other forums that this is often a difficult error to pin down but maybe someone can help. I am opening a new form from a subform. The following works ok but means opening the whole recordset and moving to the one I want:
DoCmd.OpenForm "frmClientPODetail", OpenArgs:=Me.PONo
What I really want to do this:
DoCmd.OpenForm "frmClientPODetail", WhereCondition:="PONo = " & Me.PONo
but this give the error above. Debugging shows that the error is generated in executing the OpenForm line itself, not in trying to open the new form.

Any suggestions?

Bob


Reply With Quote
  #2 (permalink)  
Old April 23rd, 2007, 09:24 PM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I suspect your PO Number is a text field so:
DoCmd.OpenForm "frmClientPODetail", WhereCondition:="PONo = '" & Me.PONo & "'"
...should work.


HTH RuralGuy (RG for short) acXP WinXP Pro
Reply With Quote
  #3 (permalink)  
Old April 24th, 2007, 05:07 AM
Authorized User
 
Join Date: Apr 2004
Location: LEOMINSTER, Herefordshire, United Kingdom.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks RG. Of course you're right, just because it's called a PO Number doesn't mean it really is a number!

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error 2001 You canceled the previous operation RayL Access VBA 3 December 8th, 2006 03:00 PM
The OpenForm action was canceled seananderson Access VBA 3 October 18th, 2006 12:34 PM
"you canceled the previous operation" error Totenkopf Access VBA 2 June 14th, 2006 02:48 PM
you canceled the previous operation lizhaskin Access 1 July 19th, 2005 12:36 PM
Error 2001: You canceled the previous operation RayL Access VBA 3 May 27th, 2005 07:40 AM



All times are GMT -4. The time now is 02:49 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.