J
jojo
I have a command button on my mainform that when clicked should open my
subform (Form2), with the current record (ID). The ID control is in both my
main form and subform, however I keep on getting the following error message:
"Syntax error (missing operator) in query expression 'ID='." Can anyone
figure out what is wrong with my code?
Thanks!
---------------------------
Private Sub Change_Imp_Date_Click()
On Error GoTo Err_Change_Imp_Date_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Form2"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Change_Imp_Date_Click:
Exit Sub
Err_Change_Imp_Date_Click:
MsgBox Err.Description
Resume Exit_Change_Imp_Date_Click
End Sub
subform (Form2), with the current record (ID). The ID control is in both my
main form and subform, however I keep on getting the following error message:
"Syntax error (missing operator) in query expression 'ID='." Can anyone
figure out what is wrong with my code?
Thanks!
---------------------------
Private Sub Change_Imp_Date_Click()
On Error GoTo Err_Change_Imp_Date_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Form2"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Change_Imp_Date_Click:
Exit Sub
Err_Change_Imp_Date_Click:
MsgBox Err.Description
Resume Exit_Change_Imp_Date_Click
End Sub