Test Checkboxes in Subform?

D

David Habercom

I have a subform which shows a list linked to the mainform
record. Some but not all items on the list may have a
checkbox checked (-1). How do I get the main form to
unhide a control if ANY of the boxes is checked? Can I
set a test in the query supporting the subform? Thanks.
 
J

Jim Allensworth

I have a subform which shows a list linked to the mainform
record. Some but not all items on the list may have a
checkbox checked (-1). How do I get the main form to
unhide a control if ANY of the boxes is checked? Can I
set a test in the query supporting the subform? Thanks.

You could sum the checkboxes. As simple as ...

Me.MyControl.Visible = (Me.sfrmName.Form!chkBox1 + _
Me.sfrmName.Form!chkBox2) <> 0

You might put this in the On Current event of the main form.

- Jim
 

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