A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Can we put two or three sets of data into one combobox?



 
 
Thread Tools Display Modes
  #1  
Old February 16th, 2010, 08:21 AM posted to microsoft.public.access.tablesdbdesign
guangdew via AccessMonster.com
external usenet poster
 
Posts: 14
Default Can we put two or three sets of data into one combobox?

In my database, I have Products table and Orders_Details table that contains
Product_ID field and they have one to many relationship.

On Orders_Details subform, I have a combobox Product_ID which is a bound
control. From the pulldown list, I can have Product_ID, Product_Name and
Price listed. After whichever product is selected, I want the combobox to
display both Product_Name and Price but it can show only the Product_Name
field.

I’m also thinking of use another unbound field to display the price
separately, but I have problem making it work.

Can anyone make some suggestions to me?

Thanks,

Guangdew

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...esign/201002/1

  #2  
Old February 16th, 2010, 01:56 PM posted to microsoft.public.access.tablesdbdesign
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default Can we put two or three sets of data into one combobox?

The combo box displays only the bound column after the selection, although
the drop-down list can display several columns. Use text boxes to display
other columns. In the Control Source of a text box, something like:

=[ComboBoxName].Column(1)

Column numbering is zero-based, so Column(1) is actually the second column.

BTW, price is often a value that needs to be stored so that it shows the
price at the time of the transaction, which is not necessarily the current
price. In that case you can use the After Update event to the combo box:

Me.SalePrice = Me.ComboBoxName.Column(2)

SalePrice is a field name.

guangdew wrote:
In my database, I have Products table and Orders_Details table that contains
Product_ID field and they have one to many relationship.

On Orders_Details subform, I have a combobox Product_ID which is a bound
control. From the pulldown list, I can have Product_ID, Product_Name and
Price listed. After whichever product is selected, I want the combobox to
display both Product_Name and Price but it can show only the Product_Name
field.

I’m also thinking of use another unbound field to display the price
separately, but I have problem making it work.

Can anyone make some suggestions to me?

Thanks,

Guangdew


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...esign/201002/1

  #3  
Old February 16th, 2010, 02:13 PM posted to microsoft.public.access.tablesdbdesign
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default Can we put two or three sets of data into one combobox?

On Tue, 16 Feb 2010 07:21:29 GMT, "guangdew via AccessMonster.com"
u58044@uwe wrote:

A better idea is to display the price in a textbox next to the
combobox, and set its controlsource to:
=myCombobox.Column(2)
(of course you replace myObjectNames with yours)

-Tom.
Microsoft Access MVP


In my database, I have Products table and Orders_Details table that contains
Product_ID field and they have one to many relationship.

On Orders_Details subform, I have a combobox Product_ID which is a bound
control. From the pulldown list, I can have Product_ID, Product_Name and
Price listed. After whichever product is selected, I want the combobox to
display both Product_Name and Price but it can show only the Product_Name
field.

I’m also thinking of use another unbound field to display the price
separately, but I have problem making it work.

Can anyone make some suggestions to me?

Thanks,

Guangdew

  #4  
Old February 16th, 2010, 05:01 PM posted to microsoft.public.access.tablesdbdesign
guangdew via AccessMonster.com
external usenet poster
 
Posts: 14
Default Can we put two or three sets of data into one combobox?

I tried it, it works. Thank you for your help.

Guangdew

Tom van Stiphout wrote:
A better idea is to display the price in a textbox next to the
combobox, and set its controlsource to:
=myCombobox.Column(2)
(of course you replace myObjectNames with yours)

-Tom.
Microsoft Access MVP

In my database, I have Products table and Orders_Details table that contains
Product_ID field and they have one to many relationship.

[quoted text clipped - 13 lines]

Guangdew


--
Message posted via http://www.accessmonster.com

  #5  
Old February 16th, 2010, 05:08 PM posted to microsoft.public.access.tablesdbdesign
guangdew via AccessMonster.com
external usenet poster
 
Posts: 14
Default Can we put two or three sets of data into one combobox?

The "=[ComboBoxName].Column(1)" method works fine, thank you for your help.

This Price is actually list price, so it's a field in Products table. I just
want it to be displayed here as reference. Sale_Price is a bound control to
write into Order table that need to be entered in the Orders form.

Guangew

BruceM wrote:
The combo box displays only the bound column after the selection, although
the drop-down list can display several columns. Use text boxes to display
other columns. In the Control Source of a text box, something like:

=[ComboBoxName].Column(1)

Column numbering is zero-based, so Column(1) is actually the second column.

BTW, price is often a value that needs to be stored so that it shows the
price at the time of the transaction, which is not necessarily the current
price. In that case you can use the After Update event to the combo box:

Me.SalePrice = Me.ComboBoxName.Column(2)

SalePrice is a field name.

In my database, I have Products table and Orders_Details table that contains
Product_ID field and they have one to many relationship.

[quoted text clipped - 13 lines]

Guangdew


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...esign/201002/1

  #6  
Old February 16th, 2010, 05:09 PM posted to microsoft.public.access.tablesdbdesign
guangdew via AccessMonster.com
external usenet poster
 
Posts: 14
Default Can we put two or three sets of data into one combobox?

The "=[ComboBoxName].Column(1)" method works fine, thank you for your help.

This Price is actually list price, so it's a field in Products table. I just
want it to be displayed here as reference. Sale_Price is a bound control to
write into Order table that need to be entered in the Orders form.

Guangew

BruceM wrote:
The combo box displays only the bound column after the selection, although
the drop-down list can display several columns. Use text boxes to display
other columns. In the Control Source of a text box, something like:

=[ComboBoxName].Column(1)

Column numbering is zero-based, so Column(1) is actually the second column.

BTW, price is often a value that needs to be stored so that it shows the
price at the time of the transaction, which is not necessarily the current
price. In that case you can use the After Update event to the combo box:

Me.SalePrice = Me.ComboBoxName.Column(2)

SalePrice is a field name.

In my database, I have Products table and Orders_Details table that contains
Product_ID field and they have one to many relationship.

[quoted text clipped - 13 lines]

Guangdew


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...esign/201002/1

  #7  
Old February 16th, 2010, 09:53 PM posted to microsoft.public.access.tablesdbdesign
guangdew via AccessMonster.com
external usenet poster
 
Posts: 14
Default Can we put two or three sets of data into one combobox?

The "=[ComboBoxName].Column(1)" method works fine, thank you for your help.

This Price is actually list price, so it's a field in Products table. I just
want it to be displayed here as reference. Sale_Price is a bound control to
write into Order table that need to be entered in the Orders form.

Guangew

BruceM wrote:
The combo box displays only the bound column after the selection, although
the drop-down list can display several columns. Use text boxes to display
other columns. In the Control Source of a text box, something like:

=[ComboBoxName].Column(1)

Column numbering is zero-based, so Column(1) is actually the second column.

BTW, price is often a value that needs to be stored so that it shows the
price at the time of the transaction, which is not necessarily the current
price. In that case you can use the After Update event to the combo box:

Me.SalePrice = Me.ComboBoxName.Column(2)

SalePrice is a field name.

In my database, I have Products table and Orders_Details table that contains
Product_ID field and they have one to many relationship.

[quoted text clipped - 13 lines]

Guangdew


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...esign/201002/1

  #8  
Old February 17th, 2010, 01:24 AM posted to microsoft.public.access.tablesdbdesign
guangdew via AccessMonster.com
external usenet poster
 
Posts: 14
Default Can we put two or three sets of data into one combobox?

The "=[ComboBoxName].Column(1)" method works fine, thank you for your help.

This Price is actually list price, so it's a field in Products table. I just
want it to be displayed here as reference. Sale_Price is a bound control to
write into Order table that need to be entered in the Orders form.

Guangew

BruceM wrote:
The combo box displays only the bound column after the selection, although
the drop-down list can display several columns. Use text boxes to display
other columns. In the Control Source of a text box, something like:

=[ComboBoxName].Column(1)

Column numbering is zero-based, so Column(1) is actually the second column.

BTW, price is often a value that needs to be stored so that it shows the
price at the time of the transaction, which is not necessarily the current
price. In that case you can use the After Update event to the combo box:

Me.SalePrice = Me.ComboBoxName.Column(2)

SalePrice is a field name.

In my database, I have Products table and Orders_Details table that contains
Product_ID field and they have one to many relationship.

[quoted text clipped - 13 lines]

Guangdew


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...esign/201002/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.