List Box (Still Trying)

J

Joe

I am still trying to find a solution for this problem. I
have a lookup table with two colums. There is a lookup
box on my form set to select the entries in colum 1,
persons initials, of the lookup table. When I select the
initials I want, they are entered into the lookup field
on the form. What I am looking for is a field in the form
that will automatically display the data in the second
colum, persons name, when I select the
initials from the first colum using the lookup box. I am
sure this is easy but I have not been able to come up
with an answer yet. Any help would be appreciated.

Joe
 
B

Brendan Reynolds

Private Sub lstNames_AfterUpdate()

Me!txtName = Me!lstNames.Column(1)

End Sub

Where 'lstNames' is the listbox, and 'txtName' is the textbox.

Note that the Column property is zero-based, so Column(1) is the second
column.
 
J

Joe

Thanks, Brendan. I'll give it a go.

Joe
-----Original Message-----
Private Sub lstNames_AfterUpdate()

Me!txtName = Me!lstNames.Column(1)

End Sub

Where 'lstNames' is the listbox, and 'txtName' is the textbox.

Note that the Column property is zero-based, so Column (1) is the second
column.

--
Brendan Reynolds (MVP)




.
 

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