Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a table that has 3 check box

Status
Not open for further replies.

McWhorter

Technical User
Jul 18, 2002
21
0
0
US
I have a table that has 3 check boxes(A, B, C) along with a few other fields. The records could have any combination of A,B, or C checked or none at all.

I have created a form that has 3 unbound check boxes labeled (A, B, C).

Here is what I want to do.

A command box needs to be created that will check which boxes are checked and then open a report that will show all records that have been checked.

Any suggestions.
 
Do a simple For-Each loop:

Private Sub cmdOpen_Click()
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is CheckBox Then
' look for specific control names, ex. chkFoo1, chkFoo2, chkFoo3...
If InStr(ctl.Name, "chkFoo") > 0 Then
' If checked...
If ctl.Value = True Then
'Get the tag property - which could be anything you want...
Debug.Print ctl.Tag
' do other stuff...
End If
End If
End If
Next ctl
End Sub

VBSlammer
redinvader3walking.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top