G
Guest
I am a newbie at VBA
I have a form with a list box and based on what is selected from the list
box, I want the second column (which is hidden) to determine whether other
fields on the form are visible. I tried the code below, but only get the
results of the Else statement, no matter what I choose from the list box.
Private Sub lstReports_AfterUpdate()
If Me.lstReports.Column(1) = "Date Product Fund" Then
Me.CA.Visible = False
Me.CallType.Visible = False
ElseIf Me.lstReports.Column(1) = "Date Product" Then
Me.CA.Visible = False
Me.CallType.Visible = False
Me.FundPolicy.Visible = False
Else
Me.BeginningDate.Visible = True
Me.EndDate.Visible = True
End If
End Sub
Thanks
I have a form with a list box and based on what is selected from the list
box, I want the second column (which is hidden) to determine whether other
fields on the form are visible. I tried the code below, but only get the
results of the Else statement, no matter what I choose from the list box.
Private Sub lstReports_AfterUpdate()
If Me.lstReports.Column(1) = "Date Product Fund" Then
Me.CA.Visible = False
Me.CallType.Visible = False
ElseIf Me.lstReports.Column(1) = "Date Product" Then
Me.CA.Visible = False
Me.CallType.Visible = False
Me.FundPolicy.Visible = False
Else
Me.BeginningDate.Visible = True
Me.EndDate.Visible = True
End If
End Sub
Thanks