I'm using this part of the code to open a form in a subform. I want to assign a variable to the datamode which is based on the username.
When I declare the variable as a string then the error is Type Mismatch
Code:
Dim ACMode As String
ACMode = "ACformReadOnly"
' m_Callform is the name of the form, which is passed via the Function
DoCmd.BrowseTo acForm, mCallForm, "frmSCD.NavigationSubform",[SNUmbr]=" & TempVars!TempSNumber, "", ACMode
Note: Normally I just have this:
DoCmd.BrowseTo acForm, mCallForm, "frmSCD.NavigationSubform",[SNUmbr]=" & TempVars!TempSNumber, ""
Which creates an edit mode.
I could use a conditional statement here, which is based on the user name, but I have too many screens for that.
Any Suggestions?