Cascading Comboxes

P

Peter

Hi all,

I created a data entry form with a “Cascading Combobox†according to Mr.
Steels earlier recommendations. Below works perfect when entering data

Combobox 1 holds this code in the after update event.
Combobox 2 “receives†the values from selected tbls DiffColors/Metric and
NonMetric.

Select Case 1.Value

Select Case 1.Value
Case "Colors"
Me.2.RowSource = "DiffColors"
Case "Size1"
Me.2.RowSource = "Metric"
Case "Size2"
Me.2.RowSource = "NonMetric"
End Select

In my Data Edit form I have the same code/event for Combobox 1
But how/were do I code if I only want to edit Combobox 2?

If Me.1 = Colors Then
Select Me.2.Rowsource = “DiffColors†????? This does not function well..

Thanks for your patience"
 
J

Jeanette Cunningham

The problem is that when the form opens at a record for edit, the after
update for combobox 1 doesn't fire.
You can use the Current event to set the row source for combo 2.

Put code in the current event to tell combobox 2 what its row source is,
adapt the code below to suit.

Select Case 1.Value

Select Case 1.Value
Case "Colors"
Me.2.RowSource = "DiffColors"
Case "Size1"
Me.2.RowSource = "Metric"
Case "Size2"
Me.2.RowSource = "NonMetric"
End Select


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

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