Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to run a update query automatically ?

Status
Not open for further replies.

acnovice

Programmer
Jan 27, 2005
100
US
Hi,

I created one update query to update "Amount" field from InvoiceSubForm to InvoiceSubTable. "Amount" field is calculated "Q'ty x UnitPrice".
However, when I print report form, "Amount" field isn't updated automatically. So I go to Query and run that query and print report form.
Is there any way run the update query automatically ?

Thank you.
 
You could do it with VBA, on the OnOpen event.

Private Sub Report_Open(Cancel As Integer)
'this will run the query
DoCmd.SetWarnings False
DoCmd.OpenQuery "QUERYNAME", acViewNormal
End sub

John Borges
 
Hi Guys,

Thank you "jbpez"... it works perfectly.

Have a good day.
 
Hey there acnovice....seems like jbpez deserves a star!?! A star goes a long way!!

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top