Synchronizing Combo Boxes

G

Guest

I can't believe I'm having this problem. I have two combo boxes on a form.
The RowSource for ComboBox2 selects records based on the value selected in
ComboBox1.

For the AfterUpdate event of ComboBox1, I've tried saving the record,
requerying ComboBox2 (ComboBox2.requery and docmd.requery "ComboBox2") and I
can't get ComboBox2 to requery. It keeps the records from the prior value of
ComboBox1. Only when I physically change records and come back again does
ComboBox2 properly requery.

Any ideas?

Thanks,

Michael
 
F

fredg

I can't believe I'm having this problem. I have two combo boxes on a form.
The RowSource for ComboBox2 selects records based on the value selected in
ComboBox1.

For the AfterUpdate event of ComboBox1, I've tried saving the record,
requerying ComboBox2 (ComboBox2.requery and docmd.requery "ComboBox2") and I
can't get ComboBox2 to requery. It keeps the records from the prior value of
ComboBox1. Only when I physically change records and come back again does
ComboBox2 properly requery.

Any ideas?

Thanks,

Michael

Leave the rowsource of Combo2 blank.
Set it in the AfterUpdate event of combo1.
There is no need to then requery combo2.

For example...Assume that the Combo1 lets you select a ProjectID and
you want to the select from Combo2 one of several supervisors
associated with that project.

Code the Combo1 AfterUpdate event:

Combo2.RowSource = "Select TableName.SupervisorID,
TableName.SupervisorName From TableName Where TableName.ProjectID = "
& Me![ProjectID]

Of course change the table and field names as needed, as well as the
criteria.
 

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