I am trying to take the results of an inputbox and place it into a SQL statement. Here is the Code:
Function Technician()
Dim str As String
Dim strsql As String
str = InputBox("Type in Technician's Name")
strsql = "Select * from Master where Technician_Name = " & str & "; "
DoCmd.runsql strsql
End Function
I get run time error '3075'
Syntax error (Missing operator) in query expression 'Technician_Name = XXXXXXX'.
'XXXXXXX' represents whatever I put in the input box.
Any ideas?
Function Technician()
Dim str As String
Dim strsql As String
str = InputBox("Type in Technician's Name")
strsql = "Select * from Master where Technician_Name = " & str & "; "
DoCmd.runsql strsql
End Function
I get run time error '3075'
Syntax error (Missing operator) in query expression 'Technician_Name = XXXXXXX'.
'XXXXXXX' represents whatever I put in the input box.
Any ideas?