Combobox value

mauni

Registered User.
Local time
Today, 03:23
Joined
Feb 10, 2009
Messages
23
Hi

I have Users table

Users table
- userid
- firstname
- lastname

I need combobox to display two values (firstname, surname) of this table.

When user selects one of the values, the combobox should return the userid value.

The VB code is:

msgbox "userid is: " + me.combobox

How can i achieve this using Access 2007?
 
Try:

Code:
msgbox " UserId is: " & Me.combobox

JR
 
It only outputs firstname with that code.

I need it to output the userid.

How should i configure the combobox to output the userid value?
 
make the combo box as follows

1. base it on a query with 4 columns

column 1 id
column 2 [lastname] & ", " & [firstname]
column 3 [lastname]
column 4 [firstname]

set the combo box as follows

column count 4
column widths 0, 0.1, 3, 3

its the 0.1 thats the key - a small value, but not zero

Try it, I think its what you want!
 
make the combo box as follows

1. base it on a query with 4 columns

column 1 id
column 2 [lastname] & ", " & [firstname]
column 3 [lastname]
column 4 [firstname]

set the combo box as follows

column count 4
column widths 0, 0.1, 3, 3

its the 0.1 thats the key - a small value, but not zero

Try it, I think its what you want!


Thanks, this made it perfect!
 

Users who are viewing this thread

Back
Top Bottom