Pull user # from a combo box and pull the related user first and last name as well?

M

Mick

I'm trying to figure out how to create a form where I can pull the user
number from anotehr table wiht a combo box (this part I've got figured
out), and when I select the user number that I also get the user name
(from the same table that I have pulled the User #) entered into
another field in the form. I know theres a simple way I can do this,
and think I have before, but I use access so rarely that I forget most
of the tricks by the next time I use it...

Thaks for any input...

Mick
 
G

Guest

Hi Mick
The combo box need to include both fields, Id and name

Select [User #] , [User Name] From TableName

On the after update event of the combo, after the Id is selected, write the
code that will assign the value to the User name text box

Me.[User Name] = Me.[Combo Name].Column(1)

Or, in the text box control name you can write
=[Combo Name].Column(1)

Note: the column number start with 0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top