?
Solved

Add a Full Name to my combobox

Posted on 2011-09-20
3
Medium Priority
?
273 Views
Last Modified: 2012-08-14
I have table in VB6 and want to put the Last name, comma, First Name in the drop down box on my form.  

After I pull up the data from database, the Last name is located in field(2)  The first name is in field(1)

Here is my code below for adding rec.Fields(2) to my dropdown box.  I don't know how to also add the first name to the same line in my drop down.

Would it look something like this?  

.AddItem rec.Fields(2), rec.Fields(1)
With Combo1
    Do While Not rec.EOF
    .AddItem rec.Fields(2)
    rec.MoveNext
    Loop
End With

Open in new window

0
Comment
Question by:al4629740
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 34

Accepted Solution

by:
Paul MacDonald earned 2000 total points
ID: 36569711
  ...
   .AddItem rec.Fields(2) + "," + rec.Fields(1)
   ...
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 36570307
Just a very tiny tweak. It should probably be a comma plus a space between the parts of the names.

.AddItem rec.Fields(2) + ", " + rec.Fields(1)
0
 

Author Comment

by:al4629740
ID: 36570374
thank you!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month9 days, 16 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question