YES/NO FIELD IN SUBFORM

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a subform showing records with a Yes/No field. If the field is checked
a macro will append the record to another table.
My problem is that I would like the subform to immediately update after
checking the field but it does it only if I go to another record. If I exit
the subform and press the command button the field is not updated. A macro
linked to AfterInsert or onEnter etc... would give an error stating the
subform is not open.

Is there a way to do it?

Thanks beforehand
 
Not sure why you are appending the record to another table, but I will wager
that this append should not occur if the record does not get saved, e.g. if
the user undoes it or it fails a validation rule.

The AfterInsert event of the subform itself is the first notification you
receive that a new record has been created, so it makes sense to use that
event. However, you will also need to use the AfterUpdate event of the form
(not control) to make any adjustment if the record was edited, or the
AfterDelConfirm event to make any adjustment if the subform record was
deleted.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
Thanks for your help, but I have solved the problem in the meanwhile.

Would you share your solution so others could benefit from it, too?

Larry Linson
Microsoft Access MVP
 
Back
Top