Dependent Combo Box Display

Voltron

Defender of the universe
Local time
Today, 07:01
Joined
Jul 9, 2009
Messages
77
This is probably a really simple solution that I am overlooking, but I am just not able to figure this one out.

I have two combo boxes (User ID and Assignment ID). The Assignment ID combo box is dependent on the User ID combo box. This works just fine. However, this is what I want to do. The User ID is essentially in this form (LLLL00) with the first four characters being letters and the last 2 being numbers. I want to display the first AND last names of the person in the combo boxes as opposed to the User ID. I have it where the first OR the last name appear, depending on how I set up the query, but not both.

Is there any way to accomplish this?

On a side note. I did not realize that this site had a reputation aspect to it. My apologies for not adding to the rep of all those who have helped me to greatly thus far. I will be adding to your rep.
 
I've been mulling this over in my mind.

Would something like this (or at least along these lines) work?


Dim FirstName as string
Dim LastName as string

SQL statement to pull out first name = FirstName
SQL statement to pull out last name = LastName

combo_User_ID = First & " " & Last


Obviously my SQL statements need a little work (lol), but does this even make sense?
 
In the combo box properties, in the rowsource, bring up the query builder and add a field something like:

Person: [FirstName]+" "+[LastName]

so that the row source now contains two fields, the User ID and the concactenated name.

Then change your column count to two, and your column widths to 0";1"

This will then display the "name" but is still identified by the user ID.
 
In the combo box properties, in the rowsource, bring up the query builder and add a field something like:

Person: [FirstName]+" "+[LastName]

so that the row source now contains two fields, the User ID and the concactenated name.

Then change your column count to two, and your column widths to 0";1"

This will then display the "name" but is still identified by the user ID.


Are [FirstName] and [LastName] supposed to represent the variables I had in the previous post or are they supposed to be direct connections to the appropriate table and field?
 
Are [FirstName] and [LastName] supposed to represent the variables I had in the previous post or are they supposed to be direct connections to the appropriate table and field?

Oh, I'm sorry, I didn't really make that clear did I? If the combo box is pulling from a table that has the users first and last name, it would be the fields from that table that represent the first and last name.
 
PERFECT!

Thank you for all of your help again.
 

Users who are viewing this thread

Back
Top Bottom