jrice174
Civil/Environmental
- Nov 8, 2004
- 129
I have a program that prints out a series of drawings. Since the user may want to only select a few of the available drawings, I have a checkbox that displays another form. This form lists checkboxes for all of the drawings with the checkbox caption being the drawing name. In order to have all of the checkboxes get checked or unchecked I have the following code.
Private Sub CheckBox1_Click()
For Each Control In Controls
If Left$(Control.Name, 3) = "cbx" And Control.Caption <> "" Then
If CheckBox1.Value = True Then Control.Value = True
If CheckBox1.Value = False Then Control.Value = False
End If
Next
End Sub
When I uncheck the boxes, it works great. When I check the boxes, it sends me back to the original form as if I have put frmPickDrawing.hide, frmMain.show.
Any idea what could make this happen?
Private Sub CheckBox1_Click()
For Each Control In Controls
If Left$(Control.Name, 3) = "cbx" And Control.Caption <> "" Then
If CheckBox1.Value = True Then Control.Value = True
If CheckBox1.Value = False Then Control.Value = False
End If
Next
End Sub
When I uncheck the boxes, it works great. When I check the boxes, it sends me back to the original form as if I have put frmPickDrawing.hide, frmMain.show.
Any idea what could make this happen?