Mulit-Select from List box

will

Registered User.
Local time
Today, 18:57
Joined
Jul 11, 2001
Messages
18
I have a list box set so I can highlight multiple entries in the list box. Is there a way that I can send the highlighted entries to a report and display all the relevent data associated with each entry?
(I want to pass the ID's from the list box to the report so I can display other information from the ID on other tables in the report as well)
Thanks
 
Here is an example of a SubRoutine that does what you ask:

Private Sub cmdPrintReport_Click()
Dim varItem As Variant
Dim strWhere As String

For Each varItem In Me![YourListBoxName].ItemsSelected
strWhere = strWhere & "YourIDField=" & Me![YourListBoxName].Column(0, varItem) & " Or "
Next varItem

strWhere = Left(strWhere, Len(strWhere) - 4) 'Remove the last " Or "

DoCmd.OpenReport "YourReportName", , , strWhere

End Sub

Change all the names of the controls in the code above to the actual names of your controls.

HTH
RDH
 
Ya beat my by seconds Ricky....

[This message has been edited by Jack Cowley (edited 10-10-2001).]
 
Only because I am a couple of years younger than you Jack ..... LOL

RDH
 

Users who are viewing this thread

Back
Top Bottom