Toggle yes/no between table fields

  • Thread starter Thread starter R. Brown
  • Start date Start date
R

R. Brown

I need one field to be yes when another field is selected no and vice-versa.
The fields are populated by check-boxes. Can someone tell me how to make
this happen?
 
Assuming you have two check boxes on a form called Chk1 and Chk2.

In the After Update event of Chk1 put;

Me!Chk2 = Not Me!Chk1

In the After Update event of Chk2 put;

Me!Chk1 = Not Me!Chk2

If you're not familiar with event procedures, open your form in design
view, select one of your check boxes and open the properties sheet.
Go to the Events tab and click the elipse (...) to the right of the line
for After Update, then select Code Builder. The VBA window will open
with the following lines already present;


Private Sub YourCheckBox_AfterUpdate ()


End Sub


The actual name of your check box will be in place of YourCheckBox.
Put the above mentioned code in between the Private Sub and
End Sub. Do the same for your other check box.
 
Back
Top