Question : Multiple combo boxes without repeating on popup list

I've got this form we'll call Books.  Each book has an identifier number (or title), and has a subtable that shows the following on a given line-
The starting page# for each chapter title, the chapter title itself, and also has two final fields that are the tricky part: Main Characters, and Sub Characters.  Of course each chapter will have multiple & varying Main and Sub characters, so a simple LookUp field won't suffice.  (Combo box preferred, as new characters could be added into the book as we go along) (...right?)

On a separate Book Search menu form, I'm creating a button that will search for a list of books that any given Main character has been in (option to check exact chapter?), and another for any given Sub character, and would like both buttons to bring up a list for the query to choose from rather than have to guess at character names in the Input box.

I got this to a stage where I have thoroughly confused myself as to how to construct the many-to-many relationships required to make such a thing happen.  (In my current database, when you click on the combo box it brings up multiple instances of a character name, because it is listing it in order of entries he/she is assigned to rather than by a base of names to choose from. Argh.)

If there was an option for a billion points on this one I'd totally do it.

Answer : Multiple combo boxes without repeating on popup list

If you're looking to get a unique listing of Main and Sub Characters, you can use the Distinct keyword:

SELECT DISTINCT MainCharacter FROM SomeTable

It would seem then that you would have some other control (a Combo or Listbox) which would list all Chapters in which the selected MainCharacter could be found. That would be done using a filtered RowSource in another combo or list:

SELECT * FROM SomeTable WHERE MainCharacter='" & Me.YourMainCharacterCombo & "'"

So you'd have cascading combos - the user would select a Main (or Sub) Character, and the next combo would be populated with data based on the previous selection.

Random Solutions  
 
programming4us programming4us