Update of tick box on clese

S

Scott

I Have a sub form with a "Yes/No" tickbox that I want to automatically
update to "Ticked" on the exit of the main form. I'd appreciate a hand if
someone has a free second. I don't know where to start looking for this one!
 
J

Jeff Boyce

Scott

Consider the BeforeUpdate event. Or are you saying you want to "reset" the
form to display a checked box on the next (new) record? If so, use the
AfterUpdate event.

If the former, you are changing the value before updating the record -- use
something like:
Me!chkYourCheckBox = True
in the BeforeUpdate event.

If the latter, use something like:
Me!chkYourCheckBox.DefaultValue = True
in the AfterUpdate event.
 
S

Scott

Thanks Jeff,

It's actually a form for printing of a bank deposit for qheques. I want it
to update the "Banked" check box so that once the cheques are deposited they
no longer show in the query. I've placed a button to preview the report and
once the report is printed I want to click on the "Close" button to close
everything off.

If I were to go back into the form, I don't want it to show the cheques just
printed onto the report, just the new ones not yet deposited.

The main form is called "frmCash" and it's sub form "frmBankDepositSub" The
sub form gets all it's info from "tblPayments" where the tick box "Banked"
is located. I'm not quite sure where the text you suggested would be placed.
Is it in the "OnClose" of the frmCash (main form)?

Thanks for your assistance. I'm very much a learner!
 
J

Jeff Boyce

Scott

Are the main form and sub form "connected" (i.e. parent & child properties
set to the matching fields)?

You've described your form design, but not your data structure, nor the SQL
of your queries.
 
Top