Activating Check Boxes

J

Judokid

I was wondering is it possible to activate other check boxes with the
selection of one check box using Macro in Forms?

For Example:

ckbox = Checkbox

"ckbox" Contacted?

If not checked (nothing appears under it OR other checkboxes are inactive)

If checked (other checkboxes appear under OR are activated allowing the
selection of the type of contact method: email, phone, letter, etc.)
 
I

ionic-fire via AccessMonster.com

I personally woud not use a macro here. Instead, add code to the AfterUpdate
event of the checkbox control (I called the control bCheck here). The
checkbox control itself stores boolean value [Checked (True) or Not Checked
(False)].

The code below this sentence should work well, really no need for an explicit
If.Then loop.

In the AfterUpdate event, add code like this

bOtherCheckBox = bCheck
bYetAnotherCheckBox = bCheck
cboPhoneNumber.Enabled = bCheck
bOneMoreBox = Not bCheck
'add code to call the AfterUpdate methods of each control if you want to run
other code as well.


Or if you would rather use use an If.then loop, play it like this:

If bCheck Then
bOtherCheckBox = True
bYetAnotherCheckBox = True
bOneMoreBox = False
Me.cboPhoneNumber.Enabled = True
Else
bOtherCheckBox = False
bYetAnotherCheckBox = False
bOneMoreBox = True
Me.cboPhoneNumber.Enabled = False
End If
 
S

Steve Schapel

Jukokid,

Yes. On the After Update event of the first checkbox, you can use a macro
with a SetValue action, or SetProperty action, depending on the version of
Access, to toggle the Enabled or Visible property of the other checkbox.
 

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