Lookup Values

  • Thread starter Thread starter RichK
  • Start date Start date
R

RichK

Hello all from a Newbie!

My question is this....

I have a database that uses a ComboBox with values that are pulled from a
Table. That works fine but, When I run a report the value that is shown is
not the Item in the ComboBox it the reference value that I assigned the
Primary Key .

Basically if lets say Advertising is selected in the ComboBox, A "1" is
displayed in the report instead of "Advertising" . The Customer definitely
wont want to translate the values to the actual item.

Any help would be greatly appreciated !

TIA

The Ecaveman
 
Don't define fields as "Lookup Fields" -- that is really poor relational
database practice, and as you have discovered, it obscures what is really
stored in the field. Remove the designation of Lookup Field, use the table
with the Lookup values as the Row Source of the Combo Box, and your field as
the Control Source.

Then, when you need the descriptive information from the other table,
retrieve your data with a Query, joining the two tables on the field that
was formerly a lookup field.

The same approach of using a Query will work just fine with the lookup field
that you have, if you feel _compelled_ to keep it.

Larry Linson
Microsoft Access MVP
 
Hello all from a Newbie!

My question is this....

I have a database that uses a ComboBox with values that are pulled from a
Table. That works fine but, When I run a report the value that is shown is
not the Item in the ComboBox it the reference value that I assigned the
Primary Key .

Basically if lets say Advertising is selected in the ComboBox, A "1" is
displayed in the report instead of "Advertising" . The Customer definitely
wont want to translate the values to the actual item.

The 1 is appearing because that's what is actually stored in your
table. That very simple fact is concealed from your view by
Microsoft's misdesigned, misleading, and all but useless so-called
"Lookup" feature.

Change the Lookup tab on this field so that it's Textbox instead of
Lookup.

You can base your Report on a Query joining this table to the lookup
table, joining by the ID. This is how relational databases are
designed to work; the lookup field type gets you from A to B; using
the database relationally can get you much further!
 
If I were to change the Lookup to a text box is there a way that the user
will still be able to pick the entry from a list ?

I need a drop down field with values that are then saved in the record. If I
change the field to a text field the user will have to enter the values.

Any more help will be greatly appreciated!

Rich
 
eCaVeMaN said:
If I were to change the Lookup to a text box is there a way that the user
will still be able to pick the entry from a list ?

I need a drop down field with values that are then saved in the record. If I
change the field to a text field the user will have to enter the values.

Any more help will be greatly appreciated!

Give your users a form to enter data. No one should ever use the tables
directly. On a form you can build a ComboBox that provides the functionality
you want and you don't have to use Lookup fields in the table to accomplish it.
 
If I were to change the Lookup to a text box is there a way that the user
will still be able to pick the entry from a list ?

Of course. Use a Combo Box (the proper name of a "drop down box") on a
Form. It is NOT necessary to have a combo box in a Table in order to
use a combo box on a Form; and users should routinely use Forms for
all interaction with their data. Table datasheets have very limited
capabilities and should be used only for development and debugging.

You can use the Toolbox Wizard to create combo boxes on your Forms (or
create them manually); the only good thing the lookup wizard does is
make this process a couple of mouseclicks faster, but you don't need
the Lookup in order to create a combo.
 
I am using a Combo Box on a form but that is where I have the problem with
the report showing let's say, "1" instead of "Advertising" . That's where I
have the problem the form works fine and the data is properly displayed in
the associated table. It's when I run a report that I get the "1" instead of
the "Advertising"

Thanks in advance for any help and THANK YOU to all that have replied so
far.

ecaveman
 
I am using a Combo Box on a form but that is where I have the problem with
the report showing let's say, "1" instead of "Advertising" . That's where I
have the problem the form works fine and the data is properly displayed in
the associated table. It's when I run a report that I get the "1" instead of
the "Advertising"

Thanks in advance for any help and THANK YOU to all that have replied so
far.


The table CONTAINS a number. This *is not an error*; it's working as
designed.

The solution is to create a Query joining your two tables - the table
that you now have as the recordsource of the Report, and the lookup
table containing (1; Advertising), joining by the ID. Base the report
on this Query rather than basing it on the table.
 
Back
Top