G
Guest
I have 2 combo boxes and 5 text boxes. I want the second combo box only to
display the items that are linked to my selection in combo box 1. Then when I
select the appropriate text from combo 2, I want the 5 text boxes to display
the text that is linked to my cvombo 2 choice in my 5 text boxes. here is my
code so far which does step 2 by populating the 5 text boxes when i make a
selection in combo 2. My problem being i can't get combo 2 results to only
reflect my choice from combo 1. all choices are still displayed in combo 2
for all criteria. Here is my code so far.
Row source for combo 2 = Select distinct [SCHOOLS].[nschid],
[SCHOOLS].[SCHOOL], [SCHOOLS].[PRINCIPAL], [SCHOOLS].,
[SCHOOLS].[PHONE], [SCHOOLS].[FAX] FROM SCHOOLS;
Column count =6
Column widths = 0.5299";0.35";0.2799";0.1;0.1;0.1"
Private Sub cmb_school_BeforeUpdate(Cancel As Integer)
If cmb_SCHOOL = "*" Then
MsgBox "Select a postal code.", vbExclamation, "Postal Code"
ElseIf cmb_postcode = "" Then
MsgBox "Select a postal code.", vbExclamation, "Postal Code"
Else
txt_nschid = Forms![School]![cmb_school].Column(0)
txt_SCHOOL = Forms![School]![cmb_school].Column(1)
txt_PRINCIPAL = Forms![School]![cmb_school].Column(2)
txt_EMAIL = Forms![School]![cmb_school].Column(3)
txt_PHONE = Forms![School]![cmb_school].Column(4)
txt_FAX = Forms![School]![cmb_school].Column(5)
End If
End Sub
Do i have to use SQL in my first combo box since I can't use the rowsource
in combo 2. Any help would be appreciated.
display the items that are linked to my selection in combo box 1. Then when I
select the appropriate text from combo 2, I want the 5 text boxes to display
the text that is linked to my cvombo 2 choice in my 5 text boxes. here is my
code so far which does step 2 by populating the 5 text boxes when i make a
selection in combo 2. My problem being i can't get combo 2 results to only
reflect my choice from combo 1. all choices are still displayed in combo 2
for all criteria. Here is my code so far.
Row source for combo 2 = Select distinct [SCHOOLS].[nschid],
[SCHOOLS].[SCHOOL], [SCHOOLS].[PRINCIPAL], [SCHOOLS].,
[SCHOOLS].[PHONE], [SCHOOLS].[FAX] FROM SCHOOLS;
Column count =6
Column widths = 0.5299";0.35";0.2799";0.1;0.1;0.1"
Private Sub cmb_school_BeforeUpdate(Cancel As Integer)
If cmb_SCHOOL = "*" Then
MsgBox "Select a postal code.", vbExclamation, "Postal Code"
ElseIf cmb_postcode = "" Then
MsgBox "Select a postal code.", vbExclamation, "Postal Code"
Else
txt_nschid = Forms![School]![cmb_school].Column(0)
txt_SCHOOL = Forms![School]![cmb_school].Column(1)
txt_PRINCIPAL = Forms![School]![cmb_school].Column(2)
txt_EMAIL = Forms![School]![cmb_school].Column(3)
txt_PHONE = Forms![School]![cmb_school].Column(4)
txt_FAX = Forms![School]![cmb_school].Column(5)
End If
End Sub
Do i have to use SQL in my first combo box since I can't use the rowsource
in combo 2. Any help would be appreciated.