I fixed the syntax of the larger SQL statement that I am building and all is working. I guess my first couple hundred tries working with a bad SQL stmt messed up my thinking for the rest. By the time I finally decided to use a simpler test SQL stmt I had already messed with the other code so...
I changed the code to open the form first, then set the RecordSource of the form = sSQL and it worked perfectly with my simple SQL. Now I need to get to work on the syntax of my larger statement and figure out the rest. I will report back.
Thank you both so much for your continued assistance...
I forgot to add that, yes, I do understand that there are major differences between using the query as a recordsource and seeing the results of the query. I was just doing that as a test to make sure my SQL syntax was correct.
Thanks,
Donna
I'm sorry, frustration is getting the better of me. I know I should have put more specific results.
When I set my sSQL variable = to the RecordSource of the form that I want to open, the form opens but all of the text controls have #NAME in them, no data. I have created a simple sql (select...
kjv1611 - No, there is no reason I need to save the query first. This was just a method I found to do it. I tried your method of just setting my sSQL variable = to the RecordSource of the form that I want to open and it didn't work.
Once I know the variable sSQL contains a valid query, I can't...
Hi all,
I have created code to dynamically build a new SQL statement (I used faq705-2205 as a resource) and save it as a query in the current database. The intent is to be able to create a new query any time a user makes selections on a form and requests a 'report'. The report would just be...
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.