Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"OpenForm Cancelled" Error

Status
Not open for further replies.

RonMcIntire

Technical User
Oct 12, 2002
166
US
All:

Strange things are happening here!

I'm opening a form from a UserCode dialog and, though it didn't happen before, I am now getting the error "OpenForm Action Cancelled". I went back to a previous version and it's doing it there too. I'm using the OpenArgs feature to transfer a UserCode to the program I opening but the same thing happens when I comment out the OpenArgs.

' Open the Edit SVOrders form.
DoCmd.OpenForm "frmEDIT SVOrder (FORM) - 1024x768" ', , , , , , Me.nUsercode

1. Is there a switch in the Access program that can cause this?

2. Is there someplace else I should look?

3. What can cause this error?

Thanks

Ron
 
Try:
DoCmd.OpenForm "[frmEDIT SVOrder (FORM) - 1024x768]" ', , , , , , Me.nUsercode
...and what is that dangling single quote before the first comma?


RuralGuy (RG for short) aka Allan Bunch MS Access MVP acXP winXP Pro
Please respond to this forum so all may benefit
 
How are ya RonMcIntire . . .

Not sure if this is the issue, but if the data type of [blue]nUsercode[/blue] is numeric (not text) . . . you'll have to do two conversions to get it across (OpenArgs [purple]only accepts text[/purple]). In the call to open the form:
Code:
[blue]DoCmd.OpenForm "frmEDIT SVOrder (FORM) - 1024x768" ', , , , , , CStr(Me.nUsercode)[/blue]
Then in the form something like:
Code:
[blue]Me!TextboxName = Val(Me.OpenArgs)[/blue]
[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
All:

Thanks for your response.

As it turns out, I solved my problem by moving the statement to another location in the program. Somehow it was causing a conflict in what it was opening and when.

RG: The dangling single was to comment out the past to see if the I could get the openform cmd to work.

ACE: Actually the Usercode is an 8-character (max) string.

Thanks again for your help.

Ron
 
Excellent! Thanks for posting back with your success.

RuralGuy (RG for short) aka Allan Bunch MS Access MVP acXP winXP Pro
Please respond to this forum so all may benefit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top