Tables and forms

  • Thread starter Thread starter BusterMcT
  • Start date Start date
B

BusterMcT

Greetings:

I have a form that accesses a table. The table has three columns: Key
(Auto Number), State Code and State name.

I use a script to print a Word Document from the information. The
printed information contains the Key (Auto Number). I want it to print
out the State Code.

How do I change the properties of that table to use the State Code as
the primary data rather than the Key (Auto Number)?
Thanks for your assist!

All the best,
BusterMcT
 
Greetings:

I have a form that accesses a table. The table has three columns: Key
(Auto Number), State Code and State name.

I use a script to print a Word Document from the information. The
printed information contains the Key (Auto Number). I want it to print
out the State Code.

How do I change the properties of that table to use the State Code as
the primary data rather than the Key (Auto Number)?
Thanks for your assist!

Ummm... do you want to do this?? A Primary Key must be unique in the
table. Will you have one and only one record per state? There is no
need to change the Table in order to change what you print out. Create
a Query based on the table, selecting the state code, and print from
that query.


John W. Vinson[MVP]
 
John, thanks for your time.

I'm just using the table as dropdown list to populate an address field.
When the address is printing on the document it is printing the value
stored in the Primary Key column rather than the value stored in the
State Code Column.

I just need to know how to format the table to return the data from the
State Code Column.
I don't want to delete the Primary Key.


Terry
 
John, thanks for your time.

I'm just using the table as dropdown list to populate an address field.
When the address is printing on the document it is printing the value
stored in the Primary Key column rather than the value stored in the
State Code Column.

I just need to know how to format the table to return the data from the
State Code Column.
I don't want to delete the Primary Key.

You are misunderstanding how relational databases work. You do not
need to "format the table" - instead, you want to base your Report on
a Query joining your table to the states table. Pick up your table
fields from your table, and the state code from the states table. It
is NOT necessary (in fact it's rather uncommon) to base a Report -
even as simple a one as a mailing label! - directly on a Table; use
Queries instead.

One comment - I routinely use the two-letter state (or Canadian
province, or US Territory) code as the Primary Key of the state table.
It's short, it's stable (mostly - Canada changed the code for
Newfoundland a while back), and it's unique; despite Access' offer, it
is *NOT* necessary to have a separate autonumber primary key for a
fifty - or 76 - row table of States (provinces and territories).

John W. Vinson[MVP]
 
Back
Top