Retrieve ComboBox unbound column in record set

bee55

Registered User.
Local time
Today, 12:43
Joined
Oct 27, 2011
Messages
50
HI every one,
i have a table contain a combo box with 2bound column the first is Employee_Name and the other is Employee_ID

my code is
Code:
Dim RsStaff As DAO.Recordset
Dim VarX As String
Set FoodStuff = CurrentDb
Set RsStaff = FoodStuff.OpenRecordset("Employees")
RsStaff.movefirst   
VarX = RsStaff!Employee_Name
Msgbo Varx
The message box display the ID of selected Employee and i want it to display the Employee_Name
any help will be appriciated
thank you alot for care
 
You could try this:

VarX RsStaff.Fields("Employee_Name")

in place of :
VarX = RsStaff!Employee_Name
 
You could try this:

VarX RsStaff.Fields("Employee_Name")

in place of :
VarX = RsStaff!Employee_Name

i try this code in other table include both id number and name and it work successfull
but my table above has a combobox include both id and name but only display the name and the messagebox display id field

i would like to display the name fieled instead of id
 

Users who are viewing this thread

Back
Top Bottom