I am tying to add a second critera to the following insert query but can't get the syntax correct.
This works:
DBS.Execute "INSERT INTO SLIC_Trips " _
& "Select * " _
& "From [SLIC_Trips_All] " _
& "Where SLIC_Trips_All.District='" & [Forms]![SLIC_Miles]![TxtDistrict] _
& "'"
This doesn't:
DBS.Execute "INSERT INTO SLIC_Trips " _
& "Select * " _
& "From [SLIC_Trips_All] " _
& "Where SLIC_Trips_All.District=" & [Forms]![SLIC_Miles]![TxtDistrict] _
& " AND SLIC_Trips_All.Date=" & " 12/01/" & [Forms]![SLIC_Miles]![TxtYear] _
& "'"
Thanks in advance to taking a look.
This works:
DBS.Execute "INSERT INTO SLIC_Trips " _
& "Select * " _
& "From [SLIC_Trips_All] " _
& "Where SLIC_Trips_All.District='" & [Forms]![SLIC_Miles]![TxtDistrict] _
& "'"
This doesn't:
DBS.Execute "INSERT INTO SLIC_Trips " _
& "Select * " _
& "From [SLIC_Trips_All] " _
& "Where SLIC_Trips_All.District=" & [Forms]![SLIC_Miles]![TxtDistrict] _
& " AND SLIC_Trips_All.Date=" & " 12/01/" & [Forms]![SLIC_Miles]![TxtYear] _
& "'"
Thanks in advance to taking a look.