rob.low
Access Nutter
- Local time
- Today, 05:13
- Joined
- Dec 27, 2007
- Messages
- 96
Hi All,
I've been useing the Leban report to pdf code and it works great.
My problem is that some of my reports have no filtering from querys.
they are filterd by the following code behind a command button
that selects, selected records from a list box
this is the lebans code (slightly modified to my needs) which calls the report and converts it to pdf
I have been trying to work out how to convert the code to work with the lebans pdf code
all help, info and hints wellcomed
thanks
rob
I've been useing the Leban report to pdf code and it works great.
My problem is that some of my reports have no filtering from querys.
they are filterd by the following code behind a command button
that selects, selected records from a list box
Private Sub Command73_Click()
Dim blRet As Boolean
Dim strWhere As String
Dim ctl As Control
Dim varItem As Variant
On Error GoTo Command73_Click_Error
'make sure a selection has been made
If Me.lstCustInfo.ItemsSelected.Count = 0 Then
MsgBox "Must select at least 1 record"
Exit Sub
End If
'add selected values to string
Set ctl = Me.lstCustInfo
For Each varItem In ctl.ItemsSelected
strWhere = strWhere & ctl.ItemData(varItem) & ","
Next varItem
'trim trailing comma
strWhere = Left(strWhere, Len(strWhere) - 1)
'open the report, restricted to the selected items
DoCmd.OpenReport "clients", acPreview, , "clientid IN(" & strWhere & ")"
On Error GoTo 0
Exit Sub
Command73_Click_Error:
MsgBox "Too Meny Results to Report, Please Adjust your Search. ", vbExclamation, "Too Meny Results"
End Sub
this is the lebans code (slightly modified to my needs) which calls the report and converts it to pdf
blRet = ConvertReportToPDF("singlerecord", vbNullString, _
("Clint Record") & ".pdf", False, True, 150, "", "", 0, 0, 0)
I have been trying to work out how to convert the code to work with the lebans pdf code
all help, info and hints wellcomed
thanks
rob
Last edited: