I have a form that will run a query and open a form that uses that query as a record source. How do I hide the query so that the user only sees the form.
Thanks.
I have a form that will run a query and open a form that uses that query as a record source. How do I hide the query so that the user only sees the form.
Thanks.
This code will close a query
Alternatively you could run the query as a SQL statement so it would never actually be openedCode:DoCmd.Close acQuery, "YourQueryName"
Why are you opening query object anyway? Just open the form.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
opening the query so that the table can be updated. I can close the query but I do that after the update, I just don't want the user to ever see it.
So as already stated, convert your query to SQL and run that as code from your form - either in the Form_Load event or from a button click eventopening the query so that the table can be updated. I can close the query but I do that after the update, I just don't want the user to ever see it.
The user doesn't need to see anything happen whilst it runs
Thanks, I will give that a try.
You can use a saved query... but instead of opening the query use
Code:CurrentDb.Execute "YourQueryName", dbFailOnError