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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Put a data from form to table

Status
Not open for further replies.

stickooo

Programmer
Jun 9, 2002
24
ID
Hi,

I have a form (Client) that has SalesPrice and BalancePaid, then calculated BalanceDue (SalesPrice-BalancePaid).
I need the BalanceDue to be in the table Client.

How can I do that ?

thanks
 
I gather you've got the forms record source looking at a query with 'BalanceDue: [SalesPrice]-[BalancePaid]' in.

You could set up an UPDATE query (called UpdateQuery) based on the client Table with the Balance Due 'Update To' field set at [SalesPrice]-[BalancePaid]

After the form has been updated with new figures, you could put into the forms 'on close' event :-

Private Sub Form_Close()
DoCmd.OpenQuery "updateQuery"
End Sub

You can either have this flag up a mssg to OK the updates OR turn the mssgs OFF so it does it automatically :-

Go into TOOLS/OPTIONS/editfind tab & untick 'Action Queries'

*Note* If you have any other 'Update Queries' then this will turn off the mssgs confirming those as well.

Not sure if there's an easier solution but this will do it !
 
I'd stick with the Update Query as the Append Query just adds data onto the end of the table (instead of particular fields) which you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top