Automaticaly populate field

M

Matheus

Hi
I have a form (frm-Class) where I am entering class information with
training name, time location and participants. There is a field on this form
that is called Training Code that I would like to be automaticaly populated
based on the training name entered on this form.

The Training codes are all in a separate table called "TB-Training". Is
there a way to make the form lookup the code on this separate table and
populate it on the field?

Thanks!
 
R

Ryan

The proper way to address this issue is to create a relationship with your
two tables. Im not sure what your other table is so I will call it
"TrainingName, but if "TB-Training" and "TrainingName" were related with the
[TrainingCode], then you could build a query and add the [TrainingCode] field
that would already be assigned to a specific Training Name. After that you
would build your form on your new query and when add a new record, and select
your Training name, the Training code would automaticaly populate. If you
post your table names I will help you with the relationship and query if you
need it.
 
M

Matheus

Ryan,
I created the relationship and also the query but I must be doing something
wrong... so here are my tables and I would really apreciate your help.

TB-Training: has the following fieds
TRN# - That is my training code that I want to show automaticaly on the form
when I enter the training title
TRNTitle
TRNType
Duration
ClassSize
Expiration
PerfCheck
Exam
TRNDescr - This is the description field

TB-Class (This is the one that is fed by the form and has the following
fields)
Class ID
TRNTitle - this field has a dropdown from TB-Training
TRN# - This is the one I want from TB-Training
Time
Duration
Place
Trainer

There is a Form called "Class" that updated TB-Class and this is the one
where I would like to have the TRN# automaticaly show when I enter the TRN
Title.


Ryan said:
The proper way to address this issue is to create a relationship with your
two tables. Im not sure what your other table is so I will call it
"TrainingName, but if "TB-Training" and "TrainingName" were related with the
[TrainingCode], then you could build a query and add the [TrainingCode] field
that would already be assigned to a specific Training Name. After that you
would build your form on your new query and when add a new record, and select
your Training name, the Training code would automaticaly populate. If you
post your table names I will help you with the relationship and query if you
need it.

Matheus said:
Hi
I have a form (frm-Class) where I am entering class information with
training name, time location and participants. There is a field on this form
that is called Training Code that I would like to be automaticaly populated
based on the training name entered on this form.

The Training codes are all in a separate table called "TB-Training". Is
there a way to make the form lookup the code on this separate table and
populate it on the field?

Thanks!
 
R

Ryan

Ok, so you need a one to many relationship. The one side of the relationship
will be in TB-Training on the TRNTitle and the many side will be in TB-Class
on the TRNtitle. Once you have that relationship built, you will need to
make a query with both tables in it. Add all the field from TB-Class and
just TRN# from TB-Training. All thats left to do is to build your form based
on your new query, and when you use your dropdown to select a TRNTitle the
TRN# will automatically show up because it is related. I would also go to
the properties of this field on the form and change Enabled to False and
Locked to No because if you leave the field open for changes and a user
changes the value it will change for all records with the TRN#. Hope this
helps, let me know if not.

Remember to mark this question answered if this solves your problem.

Matheus said:
Ryan,
I created the relationship and also the query but I must be doing something
wrong... so here are my tables and I would really apreciate your help.

TB-Training: has the following fieds
TRN# - That is my training code that I want to show automaticaly on the form
when I enter the training title
TRNTitle
TRNType
Duration
ClassSize
Expiration
PerfCheck
Exam
TRNDescr - This is the description field

TB-Class (This is the one that is fed by the form and has the following
fields)
Class ID
TRNTitle - this field has a dropdown from TB-Training
TRN# - This is the one I want from TB-Training
Time
Duration
Place
Trainer

There is a Form called "Class" that updated TB-Class and this is the one
where I would like to have the TRN# automaticaly show when I enter the TRN
Title.


Ryan said:
The proper way to address this issue is to create a relationship with your
two tables. Im not sure what your other table is so I will call it
"TrainingName, but if "TB-Training" and "TrainingName" were related with the
[TrainingCode], then you could build a query and add the [TrainingCode] field
that would already be assigned to a specific Training Name. After that you
would build your form on your new query and when add a new record, and select
your Training name, the Training code would automaticaly populate. If you
post your table names I will help you with the relationship and query if you
need it.

Matheus said:
Hi
I have a form (frm-Class) where I am entering class information with
training name, time location and participants. There is a field on this form
that is called Training Code that I would like to be automaticaly populated
based on the training name entered on this form.

The Training codes are all in a separate table called "TB-Training". Is
there a way to make the form lookup the code on this separate table and
populate it on the field?

Thanks!
 

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