Hi All,
I have a Form with a Combo box on that when a user selects an option I want it to show another combo box that opens a calander.
I'm having trouble with getting the second combo box to appear when I make the selection in the first box.
I've found some code which I've put in, but I now get the error "Run Time Error 13, Type Mismatch" when I choose my option from the first combo box, the code I'm using is below.
The combo box I am choosing from is titled 'Report Title' When a user chooses 'Average Weekly Usage' from this I want the comobo box 'Start Date' to appear:
The Debug error is highlighting the line "For Each varItm In Me.Report_Title.Value" if that helps?
Private Sub Report_Title_AfterUpdate()
Call SetVisible
End Sub
Private Sub SetVisible()
Dim varItm As Variant
Dim blnVisible As Boolean
blnVisible = False
If Not IsNull(Me.Report_Title.Value) Then
For Each varItm In Me.Report_Title.Value
If varItm = "Average Weekly Usage" Then
blnVisible = True
Exit For
End If
Next varItm
End If
Me.Start_Date.Visible = blnVisible
End Sub
Many Thanks
Phil
I have a Form with a Combo box on that when a user selects an option I want it to show another combo box that opens a calander.
I'm having trouble with getting the second combo box to appear when I make the selection in the first box.
I've found some code which I've put in, but I now get the error "Run Time Error 13, Type Mismatch" when I choose my option from the first combo box, the code I'm using is below.
The combo box I am choosing from is titled 'Report Title' When a user chooses 'Average Weekly Usage' from this I want the comobo box 'Start Date' to appear:
The Debug error is highlighting the line "For Each varItm In Me.Report_Title.Value" if that helps?
Private Sub Report_Title_AfterUpdate()
Call SetVisible
End Sub
Private Sub SetVisible()
Dim varItm As Variant
Dim blnVisible As Boolean
blnVisible = False
If Not IsNull(Me.Report_Title.Value) Then
For Each varItm In Me.Report_Title.Value
If varItm = "Average Weekly Usage" Then
blnVisible = True
Exit For
End If
Next varItm
End If
Me.Start_Date.Visible = blnVisible
End Sub
Many Thanks
Phil