Syntex error when Set rs = CurrentDb.OpenRecordset in access form
Posted on 2010-11-15
Hi I have a form.
I have combo field IsT1 and a Text field Email1.
Based on what they selet on IsT1, I like to populate Email1 the email field for the full name from table tblEmployees.
On the On After update event I have the following code
Private Sub IsT1_AfterUpdate()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("select EmailA from tblEmployees where Fullname = " & Me.IsT1)
Me.Email1 = rs!EmailA
I get the following error
Syntex eror(missing opertor) in query expression Fullname = displays name '
Please advice what I'm doing wrong in my syntex