mdnuts
Registered User.
- Local time
- Yesterday, 19:08
- Joined
- May 28, 2014
- Messages
- 131
I have a bound form that normally is opened via macro. Very straight forward just has the following in the where.
I'm trying to open the same form via doCmd.
I've msgbox'd the txtProblemID and the correct ID is being passed. Where I fall into an error is on the frmUserInformation's onLoad event which uses the ID form the frmUserInformation.txtUserID box. The error I get is "Syntax error (missing operator in query expression '[fldUserID]='."
What I've narrowed it to is the timing between the docmd.openform and the onload of the form. I've tried changing the onload to be on activate - and it just opens empty.
Any ideas how to get the docmd to open the form correctly before the onload tries to fire?
Code:
[userID]=[Forms]![Home]![txtSelectUser]
Code:
DoCmd.OpenForm "frmUserInformation", , , "UserID=" & Me.txtProblemID
Code:
strEndMonth = DLookup("fldDateExpiration", "qryUserExpirationDate", "[fldUserID]=" & Me.txtUserID)
Any ideas how to get the docmd to open the form correctly before the onload tries to fire?