Question posted 2008 · +9 upvotes
Hi I need to create a query in MSAccess 2003 through code (a.k.a. VB) — how can I accomplish this?
Accepted answer +19 upvotes
A vague answer for a vague question 🙂
strSQL="SELECT * FROM tblT WHERE ID =" & Forms!Form1!txtID
Set qdf=CurrentDB.CreateQueryDef("NewQuery",strSQL)
DoCmd.OpenQuery qdf.Name
Top access-vba Q&A (6)
- MS Access RunCode Macro cannot find my procedure +15 (2013)
- VBA: Why must I set focus to control every time? +15 (2013)
- Equivalent cURL in VBA? +14 (2013)
- Retrieve column values of the selected row of a multicolumn Access listbox +12 (2011)
- Loop through all unbound controls on a form and clear data +11 (2013)
- Passing arguments to Access Forms created with 'New' +9 (2014)
access-vba solutions on this site
— top 8%.