Query wont work unless I copy and past into new on
I am createing a query in VBA, saving it, then running it, and it does not work.
But if I go into SQL mode, copy and past it into a new query it runs. I have comparied the one that does not work and the one that does and they are identical.
Here is my code to create it:
Dim dbsNorthwind As Database
Dim qdfNew As QueryDef
Dim qdfLoop As QueryDef
Dim prpLoop As Property
Set dbsNorthwind = CurrentDb 'OpenDatabase
' Create new QueryDef object. Because it has a name, it is automatically appended to the QueryDefs collection.
Set qdfNew = dbsNorthwind.CreateQueryDef("YourQueryResults", strSQL_String)