gojets1721
Registered User.
- Local time
- Today, 14:24
- Joined
- Jun 11, 2019
- Messages
- 430
I'm trying to use a combo box to allow the user to select the subform they want to use. The subforms are frm2021, frm2020, and frm2019. My code is below. Any time I try to use the combo box, I'm getting a '2450' error which says access cannot find my referenced subform. Any idea why?
Code:
Private Sub ComboYearSelection_AfterUpdate()
If Me.ComboYearSelection.Value = "2021" Then
Forms!frm2021.Visible = True
Else
Forms!frm2021.Visible = False
End If
If Me.ComboYearSelection.Value = "2020" Then
Forms!frm2020.Visible = True
Else
Forms!frm2020.Visible = False
End If
If Me.ComboYearSelection.Value = "2019" Then
Forms!frm2019.Visible = True
Else
Forms!frm2019.Visible = False
End If
End Sub