Combo Boxes

D

David Tunstall

I have two combo boxes. The second combo box values
depend on what was selected in the first combo box. My
only problem is that if I change the first combo box
after I have already picked a value, my second combo box
isn't updating to show the new values. I.E First Combo
Box I choose Pontiac so then second combo box lists
Firebird, etc...... But if I then change the first combo
box to Ford, all the pontiac cars are still showing in
the second combo box.

Hope this makes sense

Thanks
David
 
M

Mark Phillipson

Hi,

I think you need to requery the second combo box every time the first one is
updated.

Try inserting code like the following in to the first Combo Box's After
Update Event:

If Len(Me.cboComboBox1 & "") > 0 Then 'Only do if something is selected
Me.cboComboBox2.Requery 'This control will now requery the next time it
is used
Me,cboComboBox2.SetFocus 'Move the focus to second combo box
End If

HTH

--

Cheers
Mark

Free Access/Office Add-Ins at:
http://mphillipson.users.btopenworld.com/
 
D

David T

Cheers Mark
-----Original Message-----
Hi,

I think you need to requery the second combo box every time the first one is
updated.

Try inserting code like the following in to the first Combo Box's After
Update Event:

If Len(Me.cboComboBox1 & "") > 0 Then 'Only do if something is selected
Me.cboComboBox2.Requery 'This control will now requery the next time it
is used
Me,cboComboBox2.SetFocus 'Move the focus to second combo box
End If

HTH

--

Cheers
Mark

Free Access/Office Add-Ins at:
http://mphillipson.users.btopenworld.com/





.
 

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