I want to call my Query from the Form with a Button Control.<br>
<br>
How can i do this ..<br>
<br>
<br>
if any one knows.. give me responce and obliged.<br>
<br>
Thanks<br>
Assuming that your form has an underlying query that you want to re-execute; use “requery” to re-execute the query and refresh the form. Create a macro with the requery action (and execute it from the button’s click event). Or, in vb code use “DoCmd.Requery”<br>
<br>
You can always change a form’s underlying query in code by modifying the RecordSource property i.e. Form_Form1.RecordSource = "query name" and then using requery.<br>
If you're not familiar with Access's button wizard, it's a good way to start. Just make sure the wizard icon is selected when you use the toolbar to add the button to the form. Choose Category: Miscellaneous, and Action:Run Query, and follow the rest of the prompts. If you want to call the underlying query, just substitute bitbrain's code for lines 3 thru 5. This way you get error handling added "for free".
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.