Welcome to Windows Help!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

How do I add a COLUMN to combo box

 
   Windows Help (Home) -> Microsoft Access RSS
Next:  de  
Author Message
kealaz

External


Since: Feb 4, 2009
Posts: 15



(Msg. 1) Posted: Wed Apr 01, 2009 2:01 pm
Post subject: How do I add a COLUMN to combo box
Archived from groups: microsoft>public>access (more info?)

I have two combo boxes on a form. The first combo box gets info from
tblPOTODO using a select query and the following code.

SELECT tblPOTODO.PART_NO, tblPOTODO.NAME, tblPOTODO.MANUF1,
tblPOTODO.MANUF1_PN, tblPOTODO.MANUF2, tblPOTODO.MANUF2_PN, tblPOTODO.MANUF3,
tblPOTODO.MANUF3_PN FROM tblPOTODO;

The second combo box is populated when a selection is made of the first
combo box. The selections of the second combo box will be:
MANUF1
MANUF2
MANUF3

Once a selection is made on that second combo box, I would like to populate
a text box [MANUF_PN] with the corresponding MANUF_PN.

I'm using the following code to populate the second combo box from the
selection made on the first combo box.

*****************************************************
With Me.PART_NO

If IsNull(.Value) Then
Me.MANUF.RowSource = ""
Else

For I = 2 To 6 Step 2

strValue = .Column(I) & vbNullString

If Len(strValue) > 0 Then
strRowSource = strRowSource & ";" & Q & strValue & Q
End If

Next I

Me.MANUF.RowSource = Mid$(strRowSource, 2)

End If

End With
*****************************************************

My second combo box currently has these options.
MANUF1
MANUF2
MANUF3

How can I change the above code so that my combo box has two columns? Like...

MANUF1 | MANUF1_PN
MANUF2 | MANUF2_PN
MANUF3 | MANUF3_PN


If I can make this happen, then, would I be able to use the value of the
second column of the line selected as the "value" of my text box? I think
this would work.

Please help me make this happen. Thanks SO MUCH!!!

 >> Stay informed about: How do I add a COLUMN to combo box 
Back to top
Login to vote
gvaughn

External


Since: Mar 11, 2009
Posts: 1



(Msg. 2) Posted: Wed Apr 01, 2009 3:05 pm
Post subject: RE: How do I add a COLUMN to combo box
Archived from groups: per prev. post (more info?)

I do nkow that to add a cloumn to your combo box you can change it's
properties. In the property sheet in the format tab change to coulmn count to
the desire amount of fields you want to display. You also need to change the
column widths
wich work by inches. So you would change the column count to 2 and change
the column widths to 1";1" to give each column a one inch view.
"kealaz" wrote:

> I have two combo boxes on a form. The first combo box gets info from
> tblPOTODO using a select query and the following code.
>
> SELECT tblPOTODO.PART_NO, tblPOTODO.NAME, tblPOTODO.MANUF1,
> tblPOTODO.MANUF1_PN, tblPOTODO.MANUF2, tblPOTODO.MANUF2_PN, tblPOTODO.MANUF3,
> tblPOTODO.MANUF3_PN FROM tblPOTODO;
>
> The second combo box is populated when a selection is made of the first
> combo box. The selections of the second combo box will be:
> MANUF1
> MANUF2
> MANUF3
>
> Once a selection is made on that second combo box, I would like to populate
> a text box [MANUF_PN] with the corresponding MANUF_PN.
>
> I'm using the following code to populate the second combo box from the
> selection made on the first combo box.
>
> *****************************************************
> With Me.PART_NO
>
> If IsNull(.Value) Then
> Me.MANUF.RowSource = ""
> Else
>
> For I = 2 To 6 Step 2
>
> strValue = .Column(I) & vbNullString
>
> If Len(strValue) > 0 Then
> strRowSource = strRowSource & ";" & Q & strValue & Q
> End If
>
> Next I
>
> Me.MANUF.RowSource = Mid$(strRowSource, 2)
>
> End If
>
> End With
> *****************************************************
>
> My second combo box currently has these options.
> MANUF1
> MANUF2
> MANUF3
>
> How can I change the above code so that my combo box has two columns? Like...
>
> MANUF1 | MANUF1_PN
> MANUF2 | MANUF2_PN
> MANUF3 | MANUF3_PN
>
>
> If I can make this happen, then, would I be able to use the value of the
> second column of the line selected as the "value" of my text box? I think
> this would work.
>
> Please help me make this happen. Thanks SO MUCH!!!

 >> Stay informed about: How do I add a COLUMN to combo box 
Back to top
Login to vote
Piet Linden

External


Since: Mar 2, 2009
Posts: 5



(Msg. 3) Posted: Thu Apr 02, 2009 3:46 am
Post subject: Re: How do I add a COLUMN to combo box
Archived from groups: per prev. post (more info?)

On Apr 1, 4:01 pm, kealaz wrote:
> I have two combo boxes on a form. The first combo box gets info from
> tblPOTODO using a select query and the following code.
>
> SELECT tblPOTODO.PART_NO, tblPOTODO.NAME, tblPOTODO.MANUF1,
> tblPOTODO.MANUF1_PN, tblPOTODO.MANUF2, tblPOTODO.MANUF2_PN, tblPOTODO.MANUF3,
> tblPOTODO.MANUF3_PN FROM tblPOTODO;
>
> The second combo box is populated when a selection is made of the first
> combo box. The selections of the second combo box will be:
> MANUF1
> MANUF2
> MANUF3
>
> Once a selection is made on that second combo box, I would like to populate
> a text box [MANUF_PN] with the corresponding MANUF_PN.
>
> I'm using the following code to populate the second combo box from the
> selection made on the first combo box.
>
> *****************************************************
> With Me.PART_NO
>
> If IsNull(.Value) Then
> Me.MANUF.RowSource = ""
> Else
>
> For I = 2 To 6 Step 2
>
> strValue = .Column(I) & vbNullString
>
> If Len(strValue) > 0 Then
> strRowSource = strRowSource & ";" & Q & strValue & Q
> End If
>
> Next I
>
> Me.MANUF.RowSource = Mid$(strRowSource, 2)
>
> End If
>
> End With
> *****************************************************
>
> My second combo box currently has these options.
> MANUF1
> MANUF2
> MANUF3
>
> How can I change the above code so that my combo box has two columns? Like...
>
> MANUF1 | MANUF1_PN
> MANUF2 | MANUF2_PN
> MANUF3 | MANUF3_PN
>
> If I can make this happen, then, would I be able to use the value of the
> second column of the line selected as the "value" of my text box? I think
> this would work.
>
> Please help me make this happen. Thanks SO MUCH!!!

If you normalized, like I would have sworn I told you to do about 3
months ago, then you wouldn't have this problem. You could just set
the rowsource for your next combobox and requery it and everything
would work fine. There's code for this at [URL="http://www.mvps.org/access"]www.mvps.org/access[/URL] in the
forms section.
 >> Stay informed about: How do I add a COLUMN to combo box 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
combo box help - I am using access 2003. I have a table called state that lists states. I have a table called cities that has cityid, state( a lookup in the state table), and city . THis table contains states and then cities within each state. I have a table customer...

Combo Code Help Please - I am using: Me.filter = "[district name] = """ & Me.combo22 & """" Me.filteron = true to filter a combo for school district. The user can pick a district and projects for that district comes up. If a distr...

Combo Box QUESTION - Hello, I have a table, with and within each record FIELD 1 FIELD 2 FIELD 3 How do create a combo box in a form where Field 1, 2 and 3 are each selections in that combo box and not on the same line as one selection. Such that when you click on the..

Search in combo box - In a form I have a combo box listed seven thousand of inventory item in ascending order, sometimes it becomes very difficult to reach on a specific inventory item, typing the name of the inventory item is also not so use full as the name of the..

how to create a drop down list - not combo - HI, In excel you can click on a cell drop down arrow and have a series of items toselect for this field. Can this simple drop down be done in access without it being a combo? Mike
   Windows Help (Home) -> Microsoft Access All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]