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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Display first value of the combo box



 
 
Thread Tools Display Modes
  #1  
Old April 15th, 2008, 09:03 AM posted to microsoft.public.access.forms
Irene
external usenet poster
 
Posts: 208
Default Display first value of the combo box

hi, i have a question about the combo box. I have make two combo box in a
subform. one is choose the part. the second is the price. now i wanna when i
choose the part, if the part just have one price, then i want the price which
is in the second combo box will directly show me the price. if the part have
many type of price (due to different qty, so have different price), then the
user just go to select the price for that part. anybody can help me?

thanks!
  #2  
Old April 15th, 2008, 09:22 AM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Display first value of the combo box

Irene,
each item in a combo's list has a number, starting with 0 for the first one.

You can count how many items in the list, if there is only one, you can tell
the combo to show it.

In the after update event of the parts combo, or the enter or got focus
event for the price combo, put some code like this:

If Me.ComboPrice.ListCount = 1 Then
Me.ComboPrice = Me.ComboPrice.ItemData(0)
End If


Jeanette Cunningham


"Irene" wrote in message
...
hi, i have a question about the combo box. I have make two combo box in a
subform. one is choose the part. the second is the price. now i wanna when
i
choose the part, if the part just have one price, then i want the price
which
is in the second combo box will directly show me the price. if the part
have
many type of price (due to different qty, so have different price), then
the
user just go to select the price for that part. anybody can help me?

thanks!



 




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 07:26 AM.


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