Refresh/Requery combobox2 on combobox1 change

A

Arjan

Hello,

On a form I have combobox1 where I can select a department, on the same page
there are also combobox2 and combobox3, where I can select the name and on
the other their function.

Combobox2 and Combobox3 are filled with a querie which depends on the
content of combobox1. However when I change the value of combobox1 the two
other comboboxes do not change unless i manualy press "F5".

I know I can use the afterupdate function but I don't know the code, can
anyone help me? I tried "me.requery" but that did not work as all my records
changed into that specific value, so here's my second question how can I make
sure the value of the comboboxes stay connected to the correct record?

Hopefully someone can help me out!

Best regards,
Arjan
 
J

John W. Vinson

I know I can use the afterupdate function but I don't know the code, can
anyone help me? I tried "me.requery" but that did not work as all my records
changed into that specific value, so here's my second question how can I make
sure the value of the comboboxes stay connected to the correct record?

Use the Code Builder and edit it to requery the combo boxes that depend on
this one:

Private Sub firstcombobox_AfterUpdate()
Me!secondcombobox.Requery
Me!thirdcombobox.Requery
End Sub

Not sure what you mean by "stay connected". The field in the table is what it
is... nothing should be "disconnected" just by moving through records!
 

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