Auto populate a text box

  • Thread starter Thread starter bbened4
  • Start date Start date
B

bbened4

Guest
Hi, this seems so easy, but I haven't been able to figure it out. I am building a simple database. There is one main table (tblCallInfo) which includes account manager name, account manager ID, and Team Leader. I also have another table which includes the account manager name, account manager ID, and Team Leader (tblCSBRoster). Tbl CSBRoster is the lookup table. This is where I would update the account manager names is they got married, etc. The form includes the account manager name, account manager ID, and Team Leader. I want the user to be able to select the account manager name from a combo box and have the other two fields auto populate from tblCSBRoster. Please help!!!!
 
account manager name from a combo box and have the other two fields auto populate from tblCSBRoster. Please help!!!!

Make a Event AfterUpdate on the combobox

Private Sub ComboBox_AfterUpdate()
Textbox1.Value = "xx"
Textbox2.Vallue = "bb"
End Sub
 
Thanks! I am not very knowledgeable about VBA so I am not sure what to type in for the "xx" and "bb" below.

Textbox1.Value = "xx"
Textbox2.Vallue = "bb"
 
The "no code" method is to use a query as the recordSource for the form. In the query you join the main table to the lookup table. You can then select columns from both tables. If your form is already bound to a table, just make a query that selects all the columns you need and save it. Then replace the tablename in the RecordSource with the query name that you select from the combo.
 
I must be missing something. When I create the query and base my form on it, my form isn't viewable because there are not any records entered yet. I also tried the dlookup with no avail.

The only information I have entered in the database is a list of account manager names and their IDs and Team Leaders in the tblCSBRoster. That table is complete, but I want the account manager name when entered to populate the ID and Team Leader in the form which is based off the tblCallInfo.
 
If the lookup field isn't required, you'll need to change the join type between the two tables from inner to left or right depending which side the main table is on.
 

Users who are viewing this thread

Back
Top Bottom