Quote Confusion

p00le

New member
Local time
Today, 07:48
Joined
May 1, 2001
Messages
8
All,

I am trying to correct the punctuation around my query criteria. In the QBE window it looks like this

Like "U" & "*"

Since the value U will vary, I declared a variable

CriteriaStr = " """" & rstSelected!SurveyType & """" & """"[*]"""" "

My SQL statement looks like this

st5SQL = "INSERT INTO Survey ( ID, [Survey Question], Result, Remarks, [Source Requirement], [Date], Facility_Number, TeamMember )"
st5SQL = st5SQL & "SELECT Checklists.ID, Checklists.[Survey Question], Checklists.Result, Checklists.Remarks, Checklists.[Source Requirement], Checklists.Date, Checklists.Facility_Number, Checklists.TeamMember "
st5SQL = st5SQL & "FROM Checklists WHERE Checklists.ID Like '" & CriteriaStr & "' "
st5SQL = st5SQL & "ORDER BY Checklists.ID; "
DoCmd.SetWarnings False
DoCmd.RunSQL st5SQL

The debugger is not triggered when the code is run. I appreciate any ideas and/or suggestions.
Julia
 
Open the debug window and put a stop on one of the DoCmd lines. If you print the sql string in the debug window, you'll see the errors.
 

Users who are viewing this thread

Back
Top Bottom