select query in access using vb

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i wana use a select query in access using vb "my own query",i want the method
or the way tha send this query licke docmd
i tried docmd.run query bt it doesnt work in it only worked on update
 
Roy, Try this:
DoCmd.OpenQuery "yourQuery", acViewNormal, acEdit

If it's an action query and you don't want to see the warning messages that pop up to warnings of,
but make sure your turn them back on like so

DoCmd.SetWarnings False
DoCmd.OpenQuery "yourQuery", acViewNormal, acEdit
DoCmd.SetWarnings True

Hope this helps!
 
DoCmd.RunSQL only works for action and data definition
queries. It won't work for Select queries.

You can do as Reggie suggests and use DoCmd.OpenQuery
"YourQueryName", view, datamode to run an existing query.

Or use the .Execute method in DAO or ADO. The Help on these
is there if somewhat terse for the ADO.
 
Back
Top