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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combo box and populating a field

Status
Not open for further replies.

giggles7840

IS-IT--Management
Mar 8, 2002
219
US
i have built a combo box which holds the firstname and lastname values. what i cant figure out is how to get the selected value from that combo box to populate into the first name/lastname field.

this should be an easy one. please help. :)
danielle
 
right now, it will store the primary kep field and i need it to store the actual value selected.
 
In the after update event of your combo place this code.

me.LastName.=me.YourComboName.column(0)
me.FirstName.=me.YourComboName.column(1)

Change the blue parts to match the names of your controls.

HTH,
Eric
 
Sorry posted before your second post went through.

So you are saying that you want the combo box to store the value or do you have text boxes to store the last name and first name?

Eric
 
COOL. now that info is in a main form. is there a way for it to automatically populated into the sub forms?
 
You can reference a subform control by using the following syntax:

me.YourSubFormName.YourControlName

or

forms!YourMainFormName!YourSubFormName.YourControlName

HTH,
Eric
 
A few questions before we can get to the answer.

1. Is the combo box based on a query or code?

2. Does the table you are going to store the results in have a field for first name and last name or one joint field for name?
 
i created the combo boxes using the wizard based off of the parent table. each table has a first name field and and last name field. i would like the parent first name and last name to populate into the 2 child tables when the main table record is pulled.
 
or what would be really cool is for the combo boxes on the main form were search boxes. when the value is selected then the values would auto populated into the sub forms.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top