Good Morning,
I am trying to use a button's OnClick event on a subform to update a textbox control on the main form each time the button is clicked.
I get the following run-time error:
Run-time error '3075' Syntax error (missing operator) in query expression '[SchoolID]='.
when I run the following code:
Private Sub btnSelect_Click()
Dim schoolName As Variant
schoolName = DLookup("[SchoolTitle]", "Schools", "[SchoolID] = " & [Forms]![frmEnrollment]![frmEnrollmentClassManager]![List11])
Forms!frmEnrollment!txtSchoolName = schoolName
End Sub
Not sure exactly what's going on here. It works fine if I use the DLookup expression as a control source for the textbox control, but when I try and use it with VBA it gives me an error.
Thank you for your time,
-Nick