This works both out of VBA and in Access:
query = "SELECT DISTINCTROW Unitholders.[Unitholder ID], Unitholders.[Do Not Mail], Unitholders.FirstName, Unitholders.LastName, Unitholders.[E-mail], Unitholders.[E-mail2], Accounts.[Account Name], Accounts.[Account Type], Accounts.Institution...
Basically the VBA query is creating a table that is later referenced by other queries in Access proper.
For the above SELECT query, when I'm in Access, data shows up no problem. When I DoCmd.RunSQL out of VBA on the same query nothing happens. I step through the code and the table doesn't...
It's bizarre. When I copy and paste the query to SQL view and then preview it, all of the data is there. For some reason though the exact same code won't work out of VBA.
The following has no problem gathering records and inserting into a new table.
Dim query As String
query = "SELECT DISTINCTROW Unitholders.[Unitholder ID], Unitholders.[Do Not Mail], Unitholders.FirstName, Unitholders.LastName, Unitholders.[E-mail], Unitholders.[E-mail2], Accounts.[Account...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.