I have a form with a subform and I have a commanf button that is used to open another form called "frmORDERS". This form opens from records from a query called qryORDERS, and I want the query to show the record that I was Working on. So I want to pass the Criteria from the form and subform. The code that I am using is:
Dim stLinkCriteria as String
Dim stDocName as String
stDocName = "frmRES_ORDERS"
stLinkCriteria = "[RegistrationID]= '" & Me.RegistrationID & "' And [ReservationNumber]= '" & Me.ReservationSubform.Form!ReservationNumber & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
This comes back with the error the form action was canceled
when I debug stLinkCriteria is stLinkCriteria= "[RegistrationID]= '1313' And [ReservationNumber]= '4321'"
And these are the correct records that I am working on so the query works but I cant get the form to open.
Thank You for any help
Dim stLinkCriteria as String
Dim stDocName as String
stDocName = "frmRES_ORDERS"
stLinkCriteria = "[RegistrationID]= '" & Me.RegistrationID & "' And [ReservationNumber]= '" & Me.ReservationSubform.Form!ReservationNumber & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
This comes back with the error the form action was canceled
when I debug stLinkCriteria is stLinkCriteria= "[RegistrationID]= '1313' And [ReservationNumber]= '4321'"
And these are the correct records that I am working on so the query works but I cant get the form to open.
Thank You for any help