In Access, automatically populate a field based on another field?

K

Kyla Dockery

I have set up a simple database in which I only have one table. Where I need
some help is in the form, I am trying to get one of my fields to
automatically populate a letter based on the response of a pull down box in
another field. Is there anyone that can help show me how to do this?
For Example:
Field One is Document Type (has pull down list to choose from) You can either
choose Tooling, Electric, Pneumatic, Facility

Field two is Document Number (I want this to automatically put in a
corresponding letter to which ever response is chosen from Field one) For
example:
If Tooling is chosen I want it to automatically enter a T in field two.

If someone could help, I would really appreciate it!
 
R

Rick B

You should not do that. It is redundant. You already know the document
type, you don't need two fields to store it.

In your queries, reports, or forms, you can easily pull the first letter of
the type field...
Left([Document_Type],1)

Relational database normalization rules would indicate that you should not
store a piece of information twice. You should also only store one piece of
information in each field.
 
K

Kyla Dockery

I want the "T" or other letter to appear automatically in the field so that a
specific number can then be typed in after it. For example: T00001. I'm
sorry, I should have given that info!

Rick B said:
You should not do that. It is redundant. You already know the document
type, you don't need two fields to store it.

In your queries, reports, or forms, you can easily pull the first letter of
the type field...
Left([Document_Type],1)

Relational database normalization rules would indicate that you should not
store a piece of information twice. You should also only store one piece of
information in each field.

--
Rick B



Kyla Dockery said:
I have set up a simple database in which I only have one table. Where I
need
some help is in the form, I am trying to get one of my fields to
automatically populate a letter based on the response of a pull down box
in
another field. Is there anyone that can help show me how to do this?
For Example:
Field One is Document Type (has pull down list to choose from) You can
either
choose Tooling, Electric, Pneumatic, Facility

Field two is Document Number (I want this to automatically put in a
corresponding letter to which ever response is chosen from Field one) For
example:
If Tooling is chosen I want it to automatically enter a T in field two.

If someone could help, I would really appreciate it!
 
R

Rick B

Again, you don't. That is redundant. Just type "1". You can then
construct the combined field by adding the first letter of the type to the
numeric entry (formatted to allow for the zeros).

--
Rick B



Kyla Dockery said:
I want the "T" or other letter to appear automatically in the field so that
a
specific number can then be typed in after it. For example: T00001. I'm
sorry, I should have given that info!

Rick B said:
You should not do that. It is redundant. You already know the document
type, you don't need two fields to store it.

In your queries, reports, or forms, you can easily pull the first letter
of
the type field...
Left([Document_Type],1)

Relational database normalization rules would indicate that you should
not
store a piece of information twice. You should also only store one piece
of
information in each field.

--
Rick B



Kyla Dockery said:
I have set up a simple database in which I only have one table. Where I
need
some help is in the form, I am trying to get one of my fields to
automatically populate a letter based on the response of a pull down
box
in
another field. Is there anyone that can help show me how to do this?
For Example:
Field One is Document Type (has pull down list to choose from) You can
either
choose Tooling, Electric, Pneumatic, Facility

Field two is Document Number (I want this to automatically put in a
corresponding letter to which ever response is chosen from Field one)
For
example:
If Tooling is chosen I want it to automatically enter a T in field two.

If someone could help, I would really appreciate it!
 
K

Kyla Dockery

Rick, I think that I need to set up individual tables for each of my four
document types so that I can enter (somewhere) a DMax()+1 code, so that each
time the user selects one of the four document types the next field will
populate with a letter and the next available number for that particular
table. Can you please help me with this? It has something to do with an
"Intelligent Key". I know that's almost a curse word in the Access
programming field, but my four choices won't change and neither will the
assigned number after it is assigned. It will stay that way forever. My
numbers will have to be formatted to allow for five spaces ex: 00001, 00002,
I would appreciate any help you could give me in figuring this out!!

Rick B said:
Again, you don't. That is redundant. Just type "1". You can then
construct the combined field by adding the first letter of the type to the
numeric entry (formatted to allow for the zeros).

--
Rick B



Kyla Dockery said:
I want the "T" or other letter to appear automatically in the field so that
a
specific number can then be typed in after it. For example: T00001. I'm
sorry, I should have given that info!

Rick B said:
You should not do that. It is redundant. You already know the document
type, you don't need two fields to store it.

In your queries, reports, or forms, you can easily pull the first letter
of
the type field...
Left([Document_Type],1)

Relational database normalization rules would indicate that you should
not
store a piece of information twice. You should also only store one piece
of
information in each field.

--
Rick B



I have set up a simple database in which I only have one table. Where I
need
some help is in the form, I am trying to get one of my fields to
automatically populate a letter based on the response of a pull down
box
in
another field. Is there anyone that can help show me how to do this?
For Example:
Field One is Document Type (has pull down list to choose from) You can
either
choose Tooling, Electric, Pneumatic, Facility

Field two is Document Number (I want this to automatically put in a
corresponding letter to which ever response is chosen from Field one)
For
example:
If Tooling is chosen I want it to automatically enter a T in field two.

If someone could help, I would really appreciate it!
 

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