Re: Having trouble with multi-select list box in Access
From: Paul Overway (paul_at_I.hate.spam.logico-solutions.com)
Date: 02/10/05
- Next message: DebbieG: "Re: disable data entry/editing for rest of form if condition is"
- Previous message: brandelfly: "Having trouble with multi-select list box in Access"
- In reply to: brandelfly: "Having trouble with multi-select list box in Access"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 9 Feb 2005 22:29:06 -0500
Use function below by passing the name of the control...then assign the
return value to your field or text box.
Function GetItemsSelected(ctl As ListBox, IncludeQuotes As Boolean) As
Variant
Dim varThing As Variant
On Error Resume Next
For Each varThing In ctl.ItemsSelected
If IncludeQuotes Then
GetItemsSelected = GetItemsSelected & Chr(39) &
ctl.ItemData(varThing) & Chr(39) & ","
Else
GetItemsSelected = GetItemsSelected & ctl.ItemData(varThing) &
","
End If
Next
If Len(GetItemsSelected) > 0 Then
GetItemsSelected = Left(GetItemsSelected, Len(GetItemsSelected) - 1)
End If
End Function
-- Paul Overway Logico Solutions http://www.logico-solutions.com "brandelfly" <brandelfly@discussions.microsoft.com> wrote in message news:B6022513-689E-49D4-9B64-5CE0320479A7@microsoft.com... > I've set up a database and form in Access and have a multi-select list box > (listing product types). I want the field to include all selected > products > in a list separated by commas but right now, after I select multiple > products, the field is blank.
- Next message: DebbieG: "Re: disable data entry/editing for rest of form if condition is"
- Previous message: brandelfly: "Having trouble with multi-select list box in Access"
- In reply to: brandelfly: "Having trouble with multi-select list box in Access"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|