SelectedValues = SelectedValues & ", """ & lstCallExport.ItemData(varItem) & """
ASKER
ASKER
"""" & 4 & """" & " OR " & """" & 9 & """"
Private Sub ListAccessories_Click()
Dim Items As Variant
Dim Item As Variant
' NB: Make this a Private variable of the code module.
Dim Filter As String
Items = Null
For Each Item In Me!ListAccessories.ItemsSelected
Items = (Items + """ OR """) & Me!ListAccessories.ItemData(Item)
Next
Me!YourTextbox.Value = """ + Items + """
End Sub
ASKER
Private Sub ListAccessories_Click()
Dim Items As Variant
Dim Item As Variant
Items = Null
For Each Item In Me!ListAccessories.ItemsSelected
Items = (Items + """ OR """) & Me!ListAccessories.ItemData(Item)
Next
' Fill textbox:
Me!txtItemsSelected.Value = """" + Items + """"
End Sub
'inspired from http://allenbrowne.com/ser-50.html
Dim varItem As Variant 'Selected items
Dim lngLen As Long 'Length of string
Dim strDelim As String 'Delimiter for this field type.
Dim SelectedValues As String
strDelim = """"
'Loop through the ItemsSelected in the list box.
With Me.lstCallExport
For Each varItem In .ItemsSelected
If Not IsNull(varItem) Then
SelectedValues = SelectedValues & strDelim & .ItemData(varItem) & strDelim & " OR "
End If
Next
End With
'Remove trailing ' OR '
lngLen = Len(SelectedValues) - 1
If Len(SelectedValues) > 0 Then
SelectedValues = Left(SelectedValues, Len(SelectedValues) - 4)
End If
Me.YourTextBoxName = SelectedValues '******************You need to edit this*******************
ASKER
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.
TRUSTED BY
Open in new window
Open in new window
if you want the quotes thenOpen in new window