How would I take the SQL statement generated by the query design, and place it directly in to code? I would like to get away from the "docmd.openquery" statement.
thanks

How would I take the SQL statement generated by the query design, and place it directly in to code? I would like to get away from the "docmd.openquery" statement.
thanks
Copy/paste then edit as appropriate - enclose in quote marks, concatenate dynamic parameters, continuation character for multi-line code. Like:
CurrentDb.Execute "UPDATE tablename SET fieldname = " & Me.textboxname & _
" WHERE ID=" & Me.ID
This pertains only to action SQL. SELECT query only for opening a recordset object.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thank will give it a try
If you google sql2vba it should show a link to allenbrowne.com. He has a form you can build, which can not only simplify the task, but will also show you the needed changes to go from Access SQL to vBA SQL layout.
How to access design view and VBA code