I have an Access Form that when the user clicks a control button it opens a second form that has a series of checkboxes. I am "attempting" to make visible = false a certain number of checkboxes.
The checkboxes are named CkBox1, CkBox2, CkBox3 etc thru CkBox10. I have an unbound textbox on my form being opened that is populated with a Value from the First form. Let's say the number is 5. What I want to happen is CkBox6, 7, 8, 9 & 10 to be made not visible.
This is the Code from the First Form
Private Sub cmdClearChip_Click()
Dim LResponse As Integer
LResponse = MsgBox("You selected Clear Chip Reporting. Are you sure this is a WV Lottery Clear Chip reporting?" & vbNewLine & vbNewLine & _
"PLEASE NOTE: You must select the particular Machine or Machines that are being Clear Chipped. Check the box of any Machine that the Lottery is performing a Clear Chip!", vbYesNo, "CLEAR CHIP REPORTING")
'Forms!frm_ClearChipSelectMachines.txtLocNbrMachines = Me.txtNbrMachines
DoCmd.OpenForm "frm_ClearChipSelectMachines", acNormal, , , acFormEdit, acWindowNormal, "frm_ClearChipSelectMachines.txtLocNbrMachines =" & Me.txtNbrMachines
Call GenerateLVLMachineLines3(LResponse = vbYes)
Forms!frm_ClearChipSelectMachines.txtNewSeqID = Me.txtNewSeqID
DoCmd.Close acForm, "frm_LVLREportingTypeSelect", acSaveNo
And then this is the Code from the Second form.... I've tried it in the OnLoad and in the OnCurrent
Private Sub Form_Current()
Dim i As Integer
i = 10
Do Until i = Val(Me.txtLocNbrMachines)
Me.Controls("lblCkBox" & i).Visible = False
i = i - 1
I get an error saying that it's an invalid use of Null......