Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub cmdPreview_Click()
On Error GoTo Err_Preview_Click
Dim stDocName As String
stDocName = "rptSelectFromListBox"
Dim frm As Form, ctl As Control
Dim varItm As Variant
Dim strList As String
strList = ""
Set frm = Forms!frmSelectAddressesToPrint
Set ctl = frm!List0
For Each varItm In ctl.ItemsSelected
strList = strList & ctl.ItemData(varItm) & ", "
Next varItm
strList = Left(strList, Len(strList) - 2)
DoCmd.OpenReport stDocName, acPreview, , "[UniqueID] IN (" & strList & ")"
'Then reset the list box to nothing
Dim ndx As Integer
For ndx = 0 To Me.List0.ListCount - 1
Me.List0.Selected(ndx) = False
Next
Me.txtSelected = Null
Exit_cmdSelectListBox_Click:
Exit Sub
Err_cmdPreview_Click:
MsgBox Err.Description
Resume Exit_cmdPreview_Click
End Sub