If you need to return a value from it, create a pass through query using the code then execute it in a recordset option - and retrieve the return values.
If its an action query (insert/update/delete) then create it as a pass through query and execute it as a querydef object.
Thanks so much John... That helped partially...
Actually I'm trying to Validate an ID that will be entered by the user. So, what I would like to do is have a command button called Validate which when clicked should fire the pass-through SQL query that I have already created and based on the value returned give an appt message in the message box.
How can I call this pre-created query in my VBA code?
I have created a pass-through SQL query in my Access application and I would like to fire this query using a command button. How can I call this query in the "On click" procedure in my VBA code?
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.