|
Access 2003 Frt end, SQL 2000 Back end
My listbox has 2 columns "UserID" & "FullName" (UserID is a Primary
Key)
I am trying to loop thru the multi-select listbox to print a separate
report for each user selected.
However, I need for the UserID and Fullname from the listbox to print
on the report. Ihave tried a couple of different options below without
success. I can't seem to grab the FullName from the 2nd column. I may
be going about this all wrong.
The msgbox line is for testing w/o printing.
As Always, Any Help Appreciated!
Dim stDocName As String
Dim Myname As Variant
Dim User1, User2 As String
For Each Myname In Me!List6.ItemsSelected
User1 = Me.List6.ItemData(Myname)
'User2 = Me.List6.Column(1).ItemData(Myname)
'User2 = DLookup("[UserID]", "tblReg", "[UserID] =" & User1)
MsgBox (User1 & vbCrLf & vbCrLf & User2)
'stDocName = "rptScanSt_Multi"
'DoCmd.OpenReport stDocName, acViewPreview
Next Myname |