basing TWO combo boxes on another combo box in a form.

G

Guest

I have been able to base ONE combo box on another combo box using an article
at the Office online website. But I have THREE combos I need to 'join' (if
thats right word).

Customer combo box
Delivery Address combo box
Customer Contact combo box

I have managed to limit the delivery address combo list to only the customer
selected, but cannot seem to use the same code in the third box.

Any help with this would be much appreciated.
 
B

BruceM

You should post the code you are using, along with a bit more information
about the table structure. Are Delivery Address and Contact in the Customer
table, or are they in related tables, or what exactly? Also, it may be
helpful to know which specific article on the Office website is the basis of
your approach.
 
G

Guest

Sorry the code is :-

Private Sub cus_AfterUpdate()
Me.del = Null
Me.del.Requery
Me.del = Me.del.ItemData(0)
End Sub


Private Sub Form_Current()
Me.del.Requery
End Sub

Private Sub Form_Load()
Me.cus = Me.cus.ItemData(0)
Call cus_AfterUpdate
End Sub
 
G

Guest

The prefered approach for me to filter one combo based on another, is to
filter the RowSource on the second combo by the selection of the first one.

The RowSource of combo 2 will have

Select FieldNAme From TableNAme Where FieldName =
Forms![FormName]![Combo1Name]

On the After Update event of combo one I run the code
Me.[Combo2Name].Requery

To refresh the list
***********************************
In this method Combo 3 will have that type of SQL as it's RowSource to
include the filter of two combo's

Select FieldName From TableName Where FieldName1 =
Forms![FormName]![Combo1Name] And FieldName2 = Forms![FormName]![Combo2Name]

On the AfterUpdate event of Combo2 run the code
Me.[Combo3Name].Requery
***********************************
 
G

Guest

GOT IT!!

Thank you very much to Ofer Cohen and BruceM.



Ofer Cohen said:
The prefered approach for me to filter one combo based on another, is to
filter the RowSource on the second combo by the selection of the first one.

The RowSource of combo 2 will have

Select FieldNAme From TableNAme Where FieldName =
Forms![FormName]![Combo1Name]

On the After Update event of combo one I run the code
Me.[Combo2Name].Requery

To refresh the list
***********************************
In this method Combo 3 will have that type of SQL as it's RowSource to
include the filter of two combo's

Select FieldName From TableName Where FieldName1 =
Forms![FormName]![Combo1Name] And FieldName2 = Forms![FormName]![Combo2Name]

On the AfterUpdate event of Combo2 run the code
Me.[Combo3Name].Requery
***********************************


--
Good Luck
BS"D


geeves1293 said:
I have been able to base ONE combo box on another combo box using an article
at the Office online website. But I have THREE combos I need to 'join' (if
thats right word).

Customer combo box
Delivery Address combo box
Customer Contact combo box

I have managed to limit the delivery address combo list to only the customer
selected, but cannot seem to use the same code in the third box.

Any help with this would be much appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top