G
Guest
Hi!
I have a check box with a label in a form. All I want to do is to keep the
label text consistent with the checkbox state. (Say label should say
"checked" if the checkbox is checked and "unchecked" if it is unchecked).
I've put code in the Form's CURRENT function and the check box's AFTER
UPDATE function to update the label text according to the checkbox value.
I still had problems with processing UNDO events (remember, checkboxes do
NOT have an ONUNDO event!).
I modified the Form's ONUNDO to update the label text according to the
checkbox's OLDVALUE value. That worked great, except for two cases!
CASE 1
That case is someone modifying the checkbox (whose AFTERUPDATE fires and the
label is changed properly), then the user moves to the next record (CURRENT
fires for the next record, and everything works for the next record). But
then the user does UNDO! Access returns to the previous modified record but:
Form's ONUNDO does not fire at all and CURRENT fires with the changed (not
original) value of that record. But the change to the checkbox gets undone
nevertheless. So the label is wrong.
CASE 2
This case is similar to case 1, except the user goes to the next record and
then comes back to the changed record. If the user does UNDO then, the Form's
ONUNDO does not fire (nothing fires at all, as far as I can see). But the
change to the value of the checkbox gets undone.
Any ideas?
Thanks a lot,
- Igor
P.S. Microsoft's KB Article regarding AfterUpdate events fails to call the
AfterUpdate event in the cases 1 and 2 above.
I have a check box with a label in a form. All I want to do is to keep the
label text consistent with the checkbox state. (Say label should say
"checked" if the checkbox is checked and "unchecked" if it is unchecked).
I've put code in the Form's CURRENT function and the check box's AFTER
UPDATE function to update the label text according to the checkbox value.
I still had problems with processing UNDO events (remember, checkboxes do
NOT have an ONUNDO event!).
I modified the Form's ONUNDO to update the label text according to the
checkbox's OLDVALUE value. That worked great, except for two cases!
CASE 1
That case is someone modifying the checkbox (whose AFTERUPDATE fires and the
label is changed properly), then the user moves to the next record (CURRENT
fires for the next record, and everything works for the next record). But
then the user does UNDO! Access returns to the previous modified record but:
Form's ONUNDO does not fire at all and CURRENT fires with the changed (not
original) value of that record. But the change to the checkbox gets undone
nevertheless. So the label is wrong.
CASE 2
This case is similar to case 1, except the user goes to the next record and
then comes back to the changed record. If the user does UNDO then, the Form's
ONUNDO does not fire (nothing fires at all, as far as I can see). But the
change to the value of the checkbox gets undone.
Any ideas?
Thanks a lot,
- Igor
P.S. Microsoft's KB Article regarding AfterUpdate events fails to call the
AfterUpdate event in the cases 1 and 2 above.