Private Sub Command4_Click()
On Error GoTo Err_Command4_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Exception Contact Info Form"
stLinkCriteria = "[Customer]=" & Me![Customer]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command4_Click:
Exit Sub
Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click
End Sub
The error is occuring at DoCmd.OpenForm stDocName, , , stLinkCriteria,
however . The error message
shows: Syntax error (missing operator) in query expression '[Customer]='.
If I take out the criteria, the form will open with no problems. Thanks!
I was asking about whether you could open the form without a criteria
strictly to determine whether the problem was with the form or with the
calling of the form. It sounds as though it's only with the calling of the
form.
I'm finding it difficult to keep track of what we've already discussed due
to how much trimming of previous posts has been done.
What is your current code, and what's the exact error message? Make sure
your code snippet includes the declaration of the variables, the
assignment
of values to them, and the actual call of the OpenForm method.
I could open the form without passing the criteria, but it would defeat
the
purpose. It's likely that the people using this won't bother to make
sure
[quoted text clipped - 11 lines]
stLinkCriteria = "[CustomerID]=" & Me![CustomerID]