It depends on the field type on what surrounds the value. For a text string itll be as you say quotes, I fits numeric its fine on it`s own but if it`s a date it needs the # symbols either side of the value.
I`ll agree though that this may be the reason for the error in this case if my memory serves me correctly.
Dim strStatus As String
Dim strMsg As String
Dim rst As Recordset
strStatus = Me.cboStatus
Set rst = CurrentDb.OpenRecordset("SELECT dbo_tblREF.* FROM dbo_tblREF WHERE (((dbo_tblREF.RefID)= " & strStatus & ";"
as an example strStatus could be Col28. I have tried to put single quotes (') inside the double quoted part of the select statement. The error i get is
Run Time error '3075'
Syntax Error in query expression '(((dbo_tblREF.RefID)='col28';'
or
Syntax Error in query expression '(((dbo_tblREF.RefID)=col28;'
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.