Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate a field based on data from another field

Status
Not open for further replies.

mslennb

Technical User
Jun 16, 2005
12
US
Hi,
I have a table (tblEmpHistory) with fields that are updated from a form.
The updated field are Personnel#, Date, Transaction Type. Name. I would like to add LastName & FirstName fields to the same table and the Names would populate based on the Personnel# that is entered. I also have a tblPersonnel with the Personnel# as the key field. I tried a combo box and it populated existing records, however, when new data is entered, the name field is "0." Please advise if there is a way to automatically update/populate. Thanks.

 
You really shouldn't be storing the names as you have their ID and can pull it with a query at any time. Is there a really good reason for denormalizing this?


Bob Larson
A2K,A2K3,A2K7,SQL Server 2000/2005,Crystal Reports 10/XI,VB6, WinXP, and Vista
Free Quick Tutorials and Samples:
 
When I look at the table, just seeing the personnel# is sometimes confusing... I thought viewing the names also would help to clarify when there is an issue with a transaction. Thanks.
 
Just build yourself a BASE query which has all of the fields of the one table and the Name from the other table. Then, whenever you need to look at the data, look at that query instead of the table. Plus you can use it to base other queries off of so you don't have to add the name in each time.


Bob Larson
A2K,A2K3,A2K7,SQL Server 2000/2005,Crystal Reports 10/XI,VB6, WinXP, and Vista
Free Quick Tutorials and Samples:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top