Cascading Drop down Menus

G

Guest

I have two cascading drop down menus. In the second dropdown I have a where
in the carrierid section ("[Forms].[PackageInfo].[cboCarrier]"). It works
nicely, however I have noticed that when I have more than one record saved
the dropdown menu does not show the correct value(the correct value is saved
in the table). It shows the filtered menu for the first record (or the
record that had the parent dropdown changed last) on all records until you
change that parent dropdown and on and on. If you can help, and this makes
sence, I would greatly appreciate it?
 
J

Jeff Boyce

James

Does the second combo box "know" to requery its source? Does the first
combo box have code in an AfterUpdate event that tells the second one to
requery?
 
G

Guest

Yes, the cascade works, the value is stored, but it does not show that on the
actual form when you go back to a saved form.

Private Sub cboCarrier_AfterUpdate()

cboService.Requery

End Sub

Jeff Boyce said:
James

Does the second combo box "know" to requery its source? Does the first
combo box have code in an AfterUpdate event that tells the second one to
requery?

--
Good luck

Jeff Boyce
<Access MVP>

James said:
I have two cascading drop down menus. In the second dropdown I have a where
in the carrierid section ("[Forms].[PackageInfo].[cboCarrier]"). It works
nicely, however I have noticed that when I have more than one record saved
the dropdown menu does not show the correct value(the correct value is saved
in the table). It shows the filtered menu for the first record (or the
record that had the parent dropdown changed last) on all records until you
change that parent dropdown and on and on. If you can help, and this makes
sence, I would greatly appreciate it?
 
G

Guest

I notice that it is not showing the correct value because the list only show
the last carrier info. for example if I have fedex on one record and then go
to another record and select ups. when I go back to the fedex record the 2nd
dropdown box only shows ups services (not fexed like it should), so the
stored value can't show it in the list. how do you only update the current
records 2nd combo with the requery technique, so when you go to other records
it does not change the 2nd drop down list?

Jeff Boyce said:
James

Does the second combo box "know" to requery its source? Does the first
combo box have code in an AfterUpdate event that tells the second one to
requery?

--
Good luck

Jeff Boyce
<Access MVP>

James said:
I have two cascading drop down menus. In the second dropdown I have a where
in the carrierid section ("[Forms].[PackageInfo].[cboCarrier]"). It works
nicely, however I have noticed that when I have more than one record saved
the dropdown menu does not show the correct value(the correct value is saved
in the table). It shows the filtered menu for the first record (or the
record that had the parent dropdown changed last) on all records until you
change that parent dropdown and on and on. If you can help, and this makes
sence, I would greatly appreciate it?
 
J

Jeff Boyce

James

If you "go back" to your first combo box, select a different choice, and the
second one doesn't refresh, the second one doesn't "know" that it is
supposed to refresh (requery).

My earlier suggestion stands -- in the AfterUpdate event of the first
combobox, put code like:
Me!cboSecondComboBox.Requery

This should cause the "cascading" of the second combo box.

--
Good luck

Jeff Boyce
<Access MVP>

James said:
I notice that it is not showing the correct value because the list only show
the last carrier info. for example if I have fedex on one record and then go
to another record and select ups. when I go back to the fedex record the 2nd
dropdown box only shows ups services (not fexed like it should), so the
stored value can't show it in the list. how do you only update the current
records 2nd combo with the requery technique, so when you go to other records
it does not change the 2nd drop down list?

Jeff Boyce said:
James

Does the second combo box "know" to requery its source? Does the first
combo box have code in an AfterUpdate event that tells the second one to
requery?

--
Good luck

Jeff Boyce
<Access MVP>

James said:
I have two cascading drop down menus. In the second dropdown I have a where
in the carrierid section ("[Forms].[PackageInfo].[cboCarrier]"). It works
nicely, however I have noticed that when I have more than one record saved
the dropdown menu does not show the correct value(the correct value is saved
in the table). It shows the filtered menu for the first record (or the
record that had the parent dropdown changed last) on all records until you
change that parent dropdown and on and on. If you can help, and this makes
sence, I would greatly appreciate it?
 
G

Guest

I did that already. As I stated earlier, the problem is not with the
AfterUpdate requery, but rather when it is requered it requeries all
comboboxes for all the record. I fixed it by also adding the requery method
to the Current portion of the form. It works great now. Thank you for your
help anyways.

Jeff Boyce said:
James

If you "go back" to your first combo box, select a different choice, and the
second one doesn't refresh, the second one doesn't "know" that it is
supposed to refresh (requery).

My earlier suggestion stands -- in the AfterUpdate event of the first
combobox, put code like:
Me!cboSecondComboBox.Requery

This should cause the "cascading" of the second combo box.

--
Good luck

Jeff Boyce
<Access MVP>

James said:
I notice that it is not showing the correct value because the list only show
the last carrier info. for example if I have fedex on one record and then go
to another record and select ups. when I go back to the fedex record the 2nd
dropdown box only shows ups services (not fexed like it should), so the
stored value can't show it in the list. how do you only update the current
records 2nd combo with the requery technique, so when you go to other records
it does not change the 2nd drop down list?

Jeff Boyce said:
James

Does the second combo box "know" to requery its source? Does the first
combo box have code in an AfterUpdate event that tells the second one to
requery?

--
Good luck

Jeff Boyce
<Access MVP>

I have two cascading drop down menus. In the second dropdown I have a
where
in the carrierid section ("[Forms].[PackageInfo].[cboCarrier]"). It works
nicely, however I have noticed that when I have more than one record saved
the dropdown menu does not show the correct value(the correct value is
saved
in the table). It shows the filtered menu for the first record (or the
record that had the parent dropdown changed last) on all records until you
change that parent dropdown and on and on. If you can help, and this
makes
sence, I would greatly appreciate it?
 

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