G
Guest
Hi Sprinks
I have main form"MICN" and subform"Requir" with several check boxes.
I tagged all check boxes in the subform. what I want to do if the user
choose the new record in the main form, then check boxes: CE30, Fee30,
Application .... in the subform "Requir" be visible. This is the code I used.
but it execute the first If statement only. IT doesn’t execute the select
case statement
Private Sub CertStatus_AfterUpdate()
Dim intCaseNumber As Integer
Dim ctl As Control
If Me.NewRecord Then
If Left(ctl.Tag, 1) = "V" Then
ctl.Vislible = True
Else
ctl.Visible = False
End If
End If
Select Case CertStatus
Case Is < 182 ' Case 1
intCaseNumber = 1
Case Is < 365 ' Case 2
intCaseNumber = 2
Case Is < 730 ' Case 3
intCaseNumber = 3
Case Is > 730 ' Case 4
intCaseNumber = 4
End Select
For Each ctl In Me.Controls
If ctl.ControlType = acCheckBox Then
If Mid(ctl.Tag, intCaseNumber, 2) = "V" Then
ctl.Visible = True
Else
ctl.Visible = False
End If
End If
Next ctl
Any help
Thanks
Amin
I have main form"MICN" and subform"Requir" with several check boxes.
I tagged all check boxes in the subform. what I want to do if the user
choose the new record in the main form, then check boxes: CE30, Fee30,
Application .... in the subform "Requir" be visible. This is the code I used.
but it execute the first If statement only. IT doesn’t execute the select
case statement
Private Sub CertStatus_AfterUpdate()
Dim intCaseNumber As Integer
Dim ctl As Control
If Me.NewRecord Then
If Left(ctl.Tag, 1) = "V" Then
ctl.Vislible = True
Else
ctl.Visible = False
End If
End If
Select Case CertStatus
Case Is < 182 ' Case 1
intCaseNumber = 1
Case Is < 365 ' Case 2
intCaseNumber = 2
Case Is < 730 ' Case 3
intCaseNumber = 3
Case Is > 730 ' Case 4
intCaseNumber = 4
End Select
For Each ctl In Me.Controls
If ctl.ControlType = acCheckBox Then
If Mid(ctl.Tag, intCaseNumber, 2) = "V" Then
ctl.Visible = True
Else
ctl.Visible = False
End If
End If
Next ctl
Any help
Thanks
Amin