Re: ComboBox

Tech-Archive recommends: Speed Up your PC by fixing your registry



John Vinson wrote:

On Tue, 6 Sep 2005 18:29:55 +0100, "Chris" <a@xxxxx> wrote:


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 <vjohns@xxxxxxxxxxxxxxxxxx> Please feel free to quote anything I say here.

.



Relevant Pages

  • ComboBox
    ... My combobox is based on a query that links 5 tables together. ... one of the dependent tables has 7 entries for one entry ... in the master table. ... if I had 7 entries for the other ...
    (microsoft.public.access.gettingstarted)
  • Re: general question about how best to cache expensive query results
    ... feeds and sometimes don't include the field ... That was my first attempt to limit the entries ... would be the result of that original query. ... presenting the underlying problem and the business requirements. ...
    (comp.databases)
  • Re: Today and Yesterday
    ... I use this query to show me how many entries are in table Information_coll ... > RogueIT, ... > Steve Schapel, Microsoft Access MVP ...
    (microsoft.public.access.queries)
  • general question about how best to cache expensive query results
    ... The question is that when I have a query like: ... entries to those that are newer than a certain date, ... ascending order in order of creation and find the highest id that's at ... as well as dealing with values having different types. ...
    (comp.databases)
  • Re: Access Table Sorting/Query Last Function
    ... I've put in a number of test entries to ensure it works, ... of the Lastin your totals query. ... I've been designing a database that basically works off two tables. ... I've done this so that I can pull the last entered ...
    (microsoft.public.access.tablesdbdesign)