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  

Multiple Selections in Combo Boxes



 
 
Thread Tools Display Modes
  #1  
Old June 1st, 2004, 03:41 PM
Matt
external usenet poster
 
Posts: n/a
Default Multiple Selections in Combo Boxes

Hey,

I was wondering if there is a way to select multiple items in combo boxes. For example, I have a combo box of county names, am I able to select multiple counties from that combo box to run my query and report with?

Thanks,

Matt
  #2  
Old June 1st, 2004, 04:14 PM
Wayne Morgan
external usenet poster
 
Posts: n/a
Default Multiple Selections in Combo Boxes

No, you will have to select them one at a time and build the list somewhere
else, concatenating in the latest selection. A listbox will do what you're
asking.

--
Wayne Morgan
MS Access MVP


"Matt" wrote in message
...
Hey,

I was wondering if there is a way to select multiple items in combo boxes.

For example, I have a combo box of county names, am I able to select
multiple counties from that combo box to run my query and report with?


  #3  
Old June 1st, 2004, 06:41 PM
Matt
external usenet poster
 
Posts: n/a
Default Multiple Selections in Combo Boxes

Wayne,

Thanks for your help. How would I send the selections somewhere else?

-Matt
  #4  
Old June 2nd, 2004, 11:59 PM
Wayne Morgan
external usenet poster
 
Posts: n/a
Default Multiple Selections in Combo Boxes

You could concatenate in a static variable or use a textbox (hidden if you
like). You may want a "clear" button to start a new string. Use the
AfterUpdate event of the combobox to concatenate the string. Using a textbox
to hold the string it would look similar to:

Me.txtMyTextbox = Me.txtMyTextbox & ", " & Me.cboMyCombobox
If Right(Nz(Me.txtMyTextbox, ""), 1) = "," Then
'remove the trailing comma
Me.txtMyTextbox = Left(Me.txtMyTextbox, Len(Me.txtMyTextbox) -1)
End If

If the text you want to concatenate is not the bound column of the combobox,
you would need to specify the column to get the data from.

--
Wayne Morgan
Microsoft Access MVP


"Matt" wrote in message
news
Wayne,

Thanks for your help. How would I send the selections somewhere
else?

-Matt



 




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 01:09 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.