Hi!
I have a form with 4 options in an option group. I would like 2 textboxes and their labels to appear only when option 4 is selected. I have written the following code, but the error "..only comments may appear after End Sub, End Function..." occurs. I have also tried a Select Case approach, but I get a similar error. Any help would by appreciated!
Private Sub Filter_Op_Group_AfterUpdate()
Dim optionNumber As String
optionNumber = Forms!F_ReportsMenu!Filter_Op_Group
If optionNumber = 4 Then Call showdates
End If
End Sub
Private Sub Form_Load()
Call hidedates
End Sub
Private Sub showdates()
Me.FromDate.Visible = True
Me.FromLabel.Visible = True
Me.ToDate.Visible = True
Me.ToLabel.Visible = True
End Sub
Private Sub hidedates()
Me.FromDate.Visible = False
Me.FromLabel.Visible = False
Me.ToDate.Visible = False
Me.ToLabel.Visible = False
End Sub
I have a form with 4 options in an option group. I would like 2 textboxes and their labels to appear only when option 4 is selected. I have written the following code, but the error "..only comments may appear after End Sub, End Function..." occurs. I have also tried a Select Case approach, but I get a similar error. Any help would by appreciated!
Private Sub Filter_Op_Group_AfterUpdate()
Dim optionNumber As String
optionNumber = Forms!F_ReportsMenu!Filter_Op_Group
If optionNumber = 4 Then Call showdates
End If
End Sub
Private Sub Form_Load()
Call hidedates
End Sub
Private Sub showdates()
Me.FromDate.Visible = True
Me.FromLabel.Visible = True
Me.ToDate.Visible = True
Me.ToLabel.Visible = True
End Sub
Private Sub hidedates()
Me.FromDate.Visible = False
Me.FromLabel.Visible = False
Me.ToDate.Visible = False
Me.ToLabel.Visible = False
End Sub