VBAhole22
Registered User.
- Local time
- Today, 17:14
- Joined
- Jan 18, 2002
- Messages
- 117
Is there a way to call
Docmd.OpenQuery
on a parameter query and pass the parameter in instead of having the user type it in?
Or even better is there a way to take a DAO recordset and just put it on the screen for the user?
Here is the reason why I ask. I want to test to see if the query returns results or not so i use an input box to get the parameter from the user. Then I set up a DAO QueryDef and set qdf.Parameter to the value from the input box. I can then test to see if the recordset returns any results or not as rst.RecordCount. This is all fine and dandy. If I get zero for an answer I can tell the user there are no results. But if I get >0 then I want to show the resulting recordset to the user. I don't want to call DoCmd.OpenQuery because that will just prompt the user for the parameter again. I'm trying to avoid that.
Any suggestions? I want to either open the query with the parameter passed in or just take the recordset I already have and shoe it to the user.
Docmd.OpenQuery
on a parameter query and pass the parameter in instead of having the user type it in?
Or even better is there a way to take a DAO recordset and just put it on the screen for the user?
Here is the reason why I ask. I want to test to see if the query returns results or not so i use an input box to get the parameter from the user. Then I set up a DAO QueryDef and set qdf.Parameter to the value from the input box. I can then test to see if the recordset returns any results or not as rst.RecordCount. This is all fine and dandy. If I get zero for an answer I can tell the user there are no results. But if I get >0 then I want to show the resulting recordset to the user. I don't want to call DoCmd.OpenQuery because that will just prompt the user for the parameter again. I'm trying to avoid that.
Any suggestions? I want to either open the query with the parameter passed in or just take the recordset I already have and shoe it to the user.