ComboBox

C

Chris

Hello All, this question is hard to explain but my application uses the
combobox in 6 different locations so please bare with me.

My combobox is based on a query that links 5 tables together.

This causes messy results that are hard to understand .e.g. master table and
2 dependent tables. one of the dependent tables has 7 entries for one entry
in the master table. I was hoping that, if I had 7 entries for the other
table all the values would be next to each other in the combo box. However,
the query shows the 7 entries as 49 entries because of the table structure.

can a combo box have two different record sources?

Terrible explanation I know, but without I diagram I can't explain it.

Oh Well it never hurt to ask.
 
J

John Vinson

Hello All, this question is hard to explain but my application uses the
combobox in 6 different locations so please bare with me.

My combobox is based on a query that links 5 tables together.

This causes messy results that are hard to understand .e.g. master table and
2 dependent tables. one of the dependent tables has 7 entries for one entry
in the master table. I was hoping that, if I had 7 entries for the other
table all the values would be next to each other in the combo box. However,
the query shows the 7 entries as 49 entries because of the table structure.

can a combo box have two different record sources?

Terrible explanation I know, but without I diagram I can't explain it.

Oh Well it never hurt to ask.

A combo box cannot have ANY recordsource - combo boxes don't have a
recordsource property; and it can have only one Row Source. I don't
see how having "two different record [sic] sources" would help you
anyhow!

That row source can be a SELECT DISTINCT query to remove duplicates,
with an ORDER BY clause to sort the records so that entries are "next
to each other", but since I don't know how your tables are structured
or exactly what you're trying to get, it's a bit hard to give specific
answers.

Why is the Combo Box based on such a complex query? Normally a combo
is used to look up data in a relatively simple query, to update a
field in some other table; how are you using it here?

John W. Vinson[MVP]
 
V

Vincent Johns

John said:
Hello All, this question is hard to explain but my application uses the
combobox in 6 different locations so please bare with me.

My combobox is based on a query that links 5 tables together.

This causes messy results that are hard to understand .e.g. master table and
2 dependent tables. one of the dependent tables has 7 entries for one entry
in the master table. I was hoping that, if I had 7 entries for the other
table all the values would be next to each other in the combo box. However,
the query shows the 7 entries as 49 entries because of the table structure.

can a combo box have two different record sources?

Terrible explanation I know, but without I diagram I can't explain it.

Oh Well it never hurt to ask.
[...]

Why is the Combo Box based on such a complex query? Normally a combo
is used to look up data in a relatively simple query, to update a
field in some other table; how are you using it here?

John W. Vinson[MVP]

Another thought (suggested by that 49) -- I suspect that you've
inadvertently asked for the Cartesian product of the table with itself.
This means that, for every record in the first (copy of the) table, you
match it with all of the records in the second (copy of the) table.

Sometimes you want to do that, most of the time you don't. In the query
you're using as the data source for the control, be sure that you
haven't included the table twice, at least not without specifying the
correct Relationship between them.

Queries can do marvelous things, such as allowing you to avoid keeping
redundant information in tables, but as with much of computer
programming, keeping your system as simple as possible (consistent with
doing the job) is a good goal.


-- Vincent Johns <[email protected]>
Please feel free to quote anything I say here.
 

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