Toggle yes/no between table fields


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.

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