Auto Update of Fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I feel like an idiot. I have a form that has the fields: Employee ID(text), First Name(text), Last Name(text), and Location(text). The Employee ID is a combo box, and the rest are simple text boxes. When I change/update the Employee ID box, I would like for the other fields to update to their cooresponding values. The problem that I am running into is that I am using two different tables for this form. The userID info is in tblEmployee and the other info that I would be comparing is in tblKeyList. Is there an SQL statement that I could use to compare both tables. Any suggestions?
 
I feel like an idiot. I have a form that has the fields: Employee ID(text), First Name(text), Last Name(text), and Location(text). The Employee ID is a combo box, and the rest are simple text boxes. When I change/update the Employee ID box, I would like for the other fields to update to their cooresponding values. The problem that I am running into is that I am using two different tables for this form. The userID info is in tblEmployee and the other info that I would be comparing is in tblKeyList. Is there an SQL statement that I could use to compare both tables. Any suggestions?

In a properly normalized database, the FirstName, LastName and
Location would be stored ONLY ONCE. Are you intentionally storing them
redundantly in the two tables? If so, why?

You can "push" the values from the combo's rowsource query into other
textboxes on the form in the Combo's AfterUpdate event with code like

Me!txtFirstName = Me!comboboxname.Column(1)

where (1) is the *second* column in the query - the Column property is
zero based.

But I'd suggest that you "unask" the question, and reconsider whether
you want this information stored redundantly at all!
 
If this combobox is bound to the underlying table then changing its value
will change the value associated with the data... not update the form to
show the data associated with the new value... if you follow me! You need a
new, unbound combo with a row source based on the ID that you can select an
ID from, and its AfterUpdate event forces a new RecordSource for the form...
Select ID 5 and Employee details 5 appears, select ID 234 and employee
details 234 appears.

HTH.

Tom.
 
Back
Top