Clearing a group of boxes on a Tabular form.

G

Guest

I have 5 fields in my DB (Customer, Legal, Date, Margin, and Net Charge). All
fields but the Net Charge I want saved to the DB as Net Charge will be
constantly changing per form. Through a query the user can pull up data by a
certain criteria whether its a date range, or a customers name. On the form
will be multiple records depending on the criteria of the user. Now the user
might input +500 in the 'Net Charge' box of the first record, and +300 in the
next record. What I need to happen (not even sure how to start this one code
wise) is when the form is closed all data in every Net Charge box is set back
to 0. I can get the text box of the current record to switch (
Net_Charge.text = "0"), but I am at a loss as to get all the Net Charge boxes
on the form to zero out. Any help would be greatly appreciated.

C_Ascheman
 
M

Mark A. Sam

Hello,

Here is an example of an Update Query which sets (Updates) a Boolean field
named [Available] to false (0) and a Date/Time named [DateLoading] field to
Null according to specific criteria in a table named [Loads].

CurrentDb.Execute "UPDATE Loads Set Available = 0, DateLoading = NULL WHERE
(CompanyID = 5509) AND (pw = 'cabbage')"

Try adapting this to your table and fields and put either on the Unload or
Close event of the form.

God Bless,

Mark A. Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top