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
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