RE: Combo Box

From: Sprinks (Sprinks_at_discussions.microsoft.com)
Date: 01/06/05


Date: Thu, 6 Jan 2005 12:17:02 -0800

The reason is at the heart of what a relational database is, and points out
the distinction between what is stored in a table and what is displayed on a
form.

By all means, display as much helpful information on your form to assist
your users, including your QualityName and abbreviation. But to store
anything other than a foreign key (the primary key of another table) is
redundant and raises potential for error.

The QualityNumber completely and unambigously defines which record you
meant, and a query joined to the Quality table will retrieve the Name and
abbreviation correctly EVERY time.

Suppose, for example, in your Orders table, you stored a customer number and
customer name with every record. It's likely that, over time, your records
might look something like this (shown for a single customer):

Cust # Name Order #
etc.
-------------- ------------------------------------------ ----------
1234 Pratt & Whitney Canada A1
1234 Pratt/Whitney Canada A16
1234 Prat and Whitney CA A23
1234 Pratt and Whitney A34

These orders were all placed by the same customer, yet all have different
names, leading to errors in searching, totalling, etc. Define the name ONCE
in the Customer table, and you avoid this problem. Also, let's say Pratt is
purchase by Boeing and the new name is Boeing/Pratt. If the name is defined
once only in the Customer table, you change the name there, and ALL of the
associated Orders will have the correct new name associated with them.

So, to display the name and abbreviation on your form, either base your form
on a multi-table query that includes those fields, or use the column property
of the combo box (Its index starts from zero). If, for example, the Name is
the 2nd column in your combo box, you can display it in a textbox by setting
its ControlSource property to:

=YourComboBox.Column(1)

Hope that helps.
Sprinks

"Brook" wrote:

> Why would I not want to store data from another table? It would give me
> details on my product?
>
> What I have is a table that houses my inventory, and I want to create a
> lookup/dropdown for the Quality, and with the quality is chosen with is
> Numeric (I.E. 50, 60, 80 etc), the quality Name and Quality Abbreviation will
> populate into my table, is this not possible?
>
> Brook
>
> "Sprinks" wrote:
>
> > Hi, Brook.
> >
> > See above post to trashman. You don't WANT to store any field from another
> > table other than the foreign key in 99.99% of cases--the main exception is
> > time-based values that are expected to change, such as a UnitPrice in the
> > Product table. The current value of it would need to be stored in the Orders
> > table.
> >
> > Display other fields on your form either by basing your form on a query, and
> > including the fields you'd like displayed, or through the Column property as
> > described.
> >
> > Sprinks
> >
> > "Brook" wrote:
> >
> > > can I set up a lookup box in a table to populate other fields within that
> > > table?
> > >
> > > Brook



Relevant Pages

  • Re: The alternative Delphi roadmap to success
    ... It does not contain support for Unicode ... Win64 and quality are big themes for Highlander. ... in this case the 'customer is always right' and your point is ...
    (borland.public.delphi.non-technical)
  • Re: Z-Plating Kudos
    ... contacting our like customer personally this morning. ... best quality surface finishing available in the industry, ... brackets can have imperfections and impurities throughout the entire ... you don't have a piece left to polish. ...
    (rec.games.pinball)
  • RE: Making one field on a form dependent on another fields results
    ... use an AutoNumber field type for the primary key. ... If your customer changes their name or address, ... > ColumnWidths How much horizontal space to allow for display of the column. ... > textbox with its control source set to the Position field. ...
    (microsoft.public.access.forms)
  • Re: A nongeneric bounded string array type (in database code)
    ... and if I get less than 20 I display them and I am done. ... Quality is scientific reality. ... -- from Zen and the Art of Motorcycle ...
    (comp.lang.ada)
  • Re: My new neighbors
    ... We now have a good drive-through and a large enough menu so we are moving away from just concentrating on excellent coffee. ... I figure if I match the speed of a national chain and exceed their quality I'll not lose too much ground. ... I deal with the ever increasing competition by maintaining my standards, improving customer service and sticking with the traditional Italian espresso menu. ... In an area where just about every retail operation has a superauto or other espresso machine, or sells a "latte", sometimes for as low as 60p I can't hope to compete on price. ...
    (alt.coffee)