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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|