Jengo,<br>Depending on whether it's an action query or select, you can use the Execute method of the querydef's SQL property (only for Action queries), or use docmd OpenQuery, "queryname".<br><br>To change criteria, either use parameters and set them through the querydef.parameters collection, or change the sql itself, by setting the sql property of the querydef obect.<br>--Jim
If you are trying to open a query and you want the criteria to be supplied by a field from your form then first open the query in design view and set the criteria for the field to: <br>forms![yourform]![yourcontrolname]<br><br>Then add a button to the form and set the click event to:<br>docmd.openquery "yourquery"<br><br>The query will open and the criteria will be supplied by the control on the form.
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.