Solved

USING COMBO CONTROL

Posted on 1998-10-27
9
229 Views
Last Modified: 2010-04-30
I HAVE A COMBO CONTROL AND WOULD LIKE TO IDENTIFY WHICH ITEM IN THE LIST A USER HAS SELECT SO THAT I CAN MOVE THE INFORMATION INTO A TEXT FIELD.
0
Comment
Question by:bbrown23
[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
  • 5
  • 4
9 Comments
 

Accepted Solution

by:
timpeters earned 50 total points
ID: 1441868
Using the following will work:
 Text1.text = combo1.list(combo1.listindex).

This will move that info into the textbox when the user selects it.
0
 

Expert Comment

by:timpeters
ID: 1441869
place that code into the Combo1_Click() event so it will execute when the user selects the info.
0
 

Author Comment

by:bbrown23
ID: 1441870
I FORGOT TO MENTION THAT THE COMO BOX IS MADE UP OF TWO COLUMNS.  HOW DO I GET THE DATA FROM COLUMN 1 INTO A TEXT FIELD AND COLUMN 2 INTO ANOTHER TEXT FIELD?
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Expert Comment

by:timpeters
ID: 1441871
First of all I believe that you are using a listbox instead of a combobox because a listbox supports multiple columns whereas a combobox does not.  Even though you have 2 columns, each piece of information still has it's own index.  Therefore the following will work:

If List1.ListIndex > List1.ListCount / 2 Then
Text1.Text = List1.List(List1.ListIndex)
Else
Text2.Text = List1.List(List1.ListIndex)
End If

0
 

Expert Comment

by:timpeters
ID: 1441872
First of all I believe that you are using a listbox instead of a combobox because a listbox supports multiple columns whereas a combobox does not.  Even though you have 2 columns, each piece of information still has it's own index.  Therefore the following will work:

If List1.ListIndex > List1.ListCount / 2 Then
Text1.Text = List1.List(List1.ListIndex)
Else
Text2.Text = List1.List(List1.ListIndex)
End If

0
 

Author Comment

by:bbrown23
ID: 1441873
I THOUGHT THAT YOU COULD USE A COMBO BOX WITH MORE THAN ONE COLUMN, AND BE ABLE TO USE IT LIKE A 2 DIMENSIONAL ARRAY. FOR EXAMPLE:

COLUMN 1       COLUMN 2

ABC              123
DEF              678
 THEN BASED ON THE USERS SLECTION MOVE THE CONTENTS OF COLUMN 1 INTO TEXT FIELD1  AND THE CONTENTS OF COLUMN 2 INTO TEXT FIELD 2

I HOPE I HAVE MADE MYSELF CLEAR?

THANKS

BRUCE BROWN
0
 

Author Comment

by:bbrown23
ID: 1441874
ONE MORE ITEM I'M USING VBA WITHIN ACCESS
0
 

Expert Comment

by:timpeters
ID: 1441875
A combo box does not support column distinction.  Although it has three different styles, eseentially it is still a dropdown box.  It cannot distinguish between columns.  It only has one.  A list box however does support multiple columns and works very similar to a combobox.  I recommend using that if you want 2 columns.  Just set it's columns property to 2.
0
 

Author Comment

by:bbrown23
ID: 1441876
JUST TO LET YOU KNOW I FOUND A WAY TO ACCESS THE DIFFERENT COLUMNS IN A COMBO BOX:

Private Sub VESSEL_AfterUpdate()
selVESSEL = vessel.Column(0)
selCPDATE = vessel.Column(1)
0

Featured Post

Technology Partners: 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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

717 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