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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenForm action cancelled 1

Status
Not open for further replies.

jpl458

Technical User
Sep 30, 2009
337
US
Have a form that opens another form and need to pass info from first form to next. Second form is a dialogue box.
Here is the code from the first form, and the code in the Open event for the dialoguebox follows. i had this working briefley, but made a chande to the dialoge, which I have since removed, which caused Run-time error 2501
The OpenForm action was cancelled. Reading up on the error is was indicated the problem is bad code in the dialogue box, but the only code in there is the open code below. Bay01 in an unconnected label, and there are several such on the screen. Tried importing the dialogue form from another version that I have, it opens but the argument is not passed.

Private Sub Bay01_DblClick(Cancel As Integer)
EventSwitch = True
Dim fromCtl As String
fromCtl = "Bay01"
DoCmd.OpenForm "BaysFilled", , , , , , fromCtl
EventSwitch = False
End Sub

Private Sub Form_Open(Cancel As Integer)
Dim fillBayArg As String
fillBayArg = fromCtl

Back at the well again.

thanks in advance

jpl

End Sub
 
I'd replace this:
fillBayArg = fromCtl
with this:
fillBayArg = Me.OpenArgs

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV, went back to square one on the dialogue, and made a new one which works using your code. Don't know whats wrong with the other two I, so forget em.

Thanks again

jpl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top