Select item in ComboBox based on string variable

EddiRae

Registered User.
Local time
Today, 09:01
Joined
Aug 4, 2007
Messages
53
I have a combobox that is filled with an ID and a name of all the active users. The data is being pulled from a table. I am concatenating the first and last name together.
Here is the code:
Code:
  [B]Trim([LastName]) & ", " & Trim([FirstName])[/B]
I am selecting the user from another form and placing the name (just like above) into a global variable.

On Load of the form in question, I am placing the global variable into column 1's value.

Here is the code:
Code:
    [B]strUser = Trim(strUserLast) & ", " & Trim(strUserFirst)
    cboUsers.Value = strUser[/B]

What is happening is that the name is not being displayed in the combobox.

Where am i going wrong?

Thanks!!
Eddi Rae
 
Even without the ".value", I am not getting the record to display.

Do you know what I am missing?

Thanks!!
Eddi Rae
 
I found my own answer ...

I make the default to the first item. Below is the sample of what to do:

cboUsers.DefaultValue = cboUsers.ItemData(0)
 

Users who are viewing this thread

Back
Top Bottom