A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Automaticaly populate field



 
 
Thread Tools Display Modes
  #1  
Old July 3rd, 2008, 05:41 PM posted to microsoft.public.access.forms
Matheus
external usenet poster
 
Posts: 12
Default Automaticaly populate field

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!
  #2  
Old July 3rd, 2008, 06:49 PM posted to microsoft.public.access.forms
Ryan
external usenet poster
 
Posts: 551
Default Automaticaly populate field

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" wrote:

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!

  #3  
Old July 4th, 2008, 01:54 AM posted to microsoft.public.access.forms
Matheus
external usenet poster
 
Posts: 12
Default Automaticaly populate field

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" wrote:

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" wrote:

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!

  #4  
Old July 7th, 2008, 02:27 PM posted to microsoft.public.access.forms
Ryan
external usenet poster
 
Posts: 551
Default Automaticaly populate field

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" wrote:

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" wrote:

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" wrote:

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!

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:03 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.