View Full Version : Combo boxes in datasheet view


acepayne
03-18-2002, 08:34 AM
Hello,

I would like to have two combo boxes on a form (in datasheet view), where the contents of combobox number two are determined by a selection made in combobox number one.

I read the Microsoft article on this subject, which explains why combobox number two will show blank records when different items are selected from the frist combobox:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q208866&id=KB;EN-US;Q208866

I am having trouble deciphering what to do to rectify this, however. The article suggests to use the DLookup() function, but I'm not sure exactly what they are getting at!

Is there a way to retain the items (display them) in all of the rows, regardless of what has been selected in my first combo box??

Any help would be great!

Thanks,
Ace

David R
03-18-2002, 08:46 AM
Which do you want to do?
Show all items in the second combo box, or restrict the list based on the first selection?

If the latter, go to the search link on this site and enter 'cascad combo box'. This question has come up more times than I can count without taking off my shoes.

HTH,
David R

DBL
03-18-2002, 10:20 AM
I've emailed you a demo on syncronised combo boxes. One of them is a sample of syncronised combos in datasheet view. There is a visual problem of viewing the results of the second combo when in datasheet view. The demo shows you how to get round that.

acepayne
03-18-2002, 10:47 AM
Thanks DBL,

This is exactly the problem I wished to address. Your sample provides me what I need to get it going. I guess adding the extra textbox control to display the item from the second combo box is the best way to do it!

It's not the prettiest thing in the universe (having the bound column (ID) showing in combobox number two), but it provides the functionality I needed!!

Thanks so much,
Ace

DBL
03-18-2002, 11:50 AM
Hi, you're right, it's not pretty and drives me mad but there's no way round it, I'm afraid. Dear Mr Gates....