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

Updating First Names when a Last Name is selected 1

Status
Not open for further replies.

gal4y

Technical User
Dec 24, 2001
72
US
I have a database for the course I teach to keep track of various projects. I want the students to pick their name from the combo box on the form (SE402 Main Table Query) [This part is complete]
But then I want to have the form update itself (after click??) and fill in the first name on the form for the last name that was picked. The first and last names are found in a table called stuff.
For some reason I can't get it to work.

Thank you in advance for any assistance

 
you will have trouble if there is more than one person with the same last name.

that being said, what is the code you have for the row source for the combo box?

you can make the combo box code have the First Name in it's result, i.e.

SELECT DISTINCTROW [Table1].[ID], [Table1].[LName], [Table1].[FName] FROM [Table1];

this will have ID, LName and FName with ID column (key) hidden. that is the combo box rowsource.

then the text box for the First Name, it's control source is:

=[cboName].[Column](2)

Column Count: 3
Column Widths: 0";1";1" OR 0";1";0"
it doesnt matter as long as where ever you have LName it is showing (not 0")

where 'cboName' is the name of your combo box. Column (2) is the third column in the combo box results (it starts counting at 0) which in my example is the First Name.

then, whenever anything in the combo box is chosen, the First Name text box automatically changes.

g
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top