Automatically a checkbox based on another field?

G

Guest

Field1 is a check box. Field2 is related, optional info.

Normal flow is when a user "checks" Field1, then enters optional info in
Field2.

However, the user could enter optional info in Field2 w/o checking Field 1.
What's the best way to automatically have Access "check" Field1?

Thanks!
 
D

Douglas J Steele

In Field2's AfterUpdate event, put code along the lines of:

Me.Field1 = (Len(Me.Field2) > 0)

In actual fact, even the following will work:

Me.Field1 = Len(Me.Field2)

since VBA treats 0 as False, and non-0 as True.
 

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

Top