Run an Update Query

  • Thread starter Thread starter O Wilson
  • Start date Start date
O

O Wilson

Hello,

I have an update query that works fine except I have to
go to design view to run it. Is there a way to run this
query using a control on a form? I'd specifically like
to have a command button that will do this for me.

TIA

Owen
 
Use the button's Click event to run code similar to this:

DoCmd.OpenQuery "QueryName"


If you want to avoid the "confirmation" message box, then turn off the
warnings before running the query and then turn them back on:

DoCmd.SetWarnings False
DoCmd.OpenQuery "QueryName"
DoCmd.SetWarnings True
 
Back
Top