ukmale65000
Registered User.
- Local time
- Today, 00:19
- Joined
- Nov 28, 2007
- Messages
- 52
I have a form which contains an unbound check box, when selected several hidden questions appear due to the code below :
Private Sub Check58_AfterUpdate()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "showd" Then
ctl.Visible = Me.Check58
End If
Next ctl
If Me.Check58 Then Me.Check58.Locked = True
End Sub
This works fine however if the user saves the record then renters it to make any additions, the checkbox is no longer ticked, reticking it again reveals the questions and indeed the answers typed in previously.
I thought it was due to check 58 being unbound, so i add a field to my table and made this the control source for the checkbox, this is where my problem lies as the system hangs before it starts and the debugger shows
Private Sub Form_Current()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "showd" Then
ctl.Visible = Me.Check58
End If
Next ctl
For Each ctl In Me.Controls
If ctl.Tag = "showp" Then
ctl.Visible = Me.Check60
End If
Next ctl
End Sub
Can anyone see where i am going wrong?
Private Sub Check58_AfterUpdate()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "showd" Then
ctl.Visible = Me.Check58
End If
Next ctl
If Me.Check58 Then Me.Check58.Locked = True
End Sub
This works fine however if the user saves the record then renters it to make any additions, the checkbox is no longer ticked, reticking it again reveals the questions and indeed the answers typed in previously.
I thought it was due to check 58 being unbound, so i add a field to my table and made this the control source for the checkbox, this is where my problem lies as the system hangs before it starts and the debugger shows
Private Sub Form_Current()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "showd" Then
ctl.Visible = Me.Check58
End If
Next ctl
For Each ctl In Me.Controls
If ctl.Tag = "showp" Then
ctl.Visible = Me.Check60
End If
Next ctl
End Sub
Can anyone see where i am going wrong?