I am making a student Database using Access. As part of my database i have a form that requires users to select from combo boxes a course. I have different course terms available corresponding to which course they select from the drop down box. The terms are also selected using a drop down box, for consistency.
In my code I have an After_Click
event procedure with the following code:
Private Sub Course_ID_AfterUpdate()
If Me![Course ID] = 1 Or Me![Course ID] = 2 Or Me![Course ID] = 3 Then
Me![Combo30].Visible = True Else: Me![Combo30].Visible = False End If
If Me![Course ID] = 4 Then Me![Combo26].Visible = True Else:
Me![Combo26].Visible = False End If
If Me![Course ID] = 5 Then Me![Combo22].Visible = True Else:
Me![Combo22].Visible = False End If
If Me![Course ID] = 6 Then Me![Combo28].Visible = True Else:
Me![Combo28].Visible = False End If
If Me![Course ID] = 7 Then Me![Combo24].Visible = True Else:
Me![Combo24].Visible = False End If
End Sub
When i first click the form all of the term drop down boxes are displaying. How do i set it (in VBA code) so that by default the Term ID
corresponding to the default Course ID
is displayed and the rest of the Term ID
drop down boxes are hidden?
Tom
I have attatched a screenshot of the default Course ID
. Notice all of the combo boxes appear to be visible.