shabbaranks
Registered User.
- Local time
- Today, 04:44
- Joined
- Oct 17, 2011
- Messages
- 300
Ok guys - yep me again. Im bambuzzled as to how VBA and sql statements are supposed to work. It seems you use different command depending on what you are trying to achieve - is this correct?
What I am trying to do is query a table based on the input of a textbox. Based on below the error U get is Syntax error (missing operator) in query expression '[ProjectRef] = & Me.ProjectRef_TotalHours &'.
What am I doing wrong?
What I am trying to do is query a table based on the input of a textbox. Based on below the error U get is Syntax error (missing operator) in query expression '[ProjectRef] = & Me.ProjectRef_TotalHours &'.
Code:
Private Sub TotalHoursOk_btn_Click()
Dim MySQL As String
MySQL = "Select * From TimesheetTable WHERE [ProjectRef] = & Me.ProjectRef_TotalHours & "
DoCmd.SetWarnings False
DoCmd.RunSQL MySQL
DoCmd.SetWarnings True
End Sub
What am I doing wrong?