I have been using a recordset to define a chunk of data I want to work with. We have decided that a temp table would be better so we could query against the smaller piece.
I have forgotten the syntax for building the TempTable. This is what I came up with but it isn’t right:
YvString = "SELECT * FROM YAV_Fc [B][COLOR=darkred]INTO YAVtemp[/COLOR][/B]" YvString = YvString & " WHERE ((Country=" YvString = YvString & Chr(34) & Country & Chr(34) YvString = YvString & ") AND (MPG=" & Chr(34) & MPG & Chr(34) & ") AND " YvString = YvString & "(BasicM=" & Basic & ") AND " YvString = YvString & "(MG=" & Chr(34) & MG & Chr(34) & "))" YvString = YvString & " ORDER by CalenPer,Priority,ABCquality;" DoCmd.RunSQL YvString
The variables are correct and worked when I was writing to RecordSet. I am using the astericks (*) because there are so many fields to pull.