lindsay_105
06-26-2006, 04:15 PM
Hi,
I am using Leban's Report2PDF code, modified as such:
Private Sub cmdMail_Click()
Dim qdf As DAO.QueryDef
'Set query to be the current record
With CurrentDb
Set qdf = .QueryDefs("Images Query")
qdf.SQL = "SELECT * FROM Images WHERE [Catalogue#]=" & Me.[Catalogue#]
qdf.Close
Set qdf = Nothing
End With
' create PDF from report using the query that was modified above
Dim blRet As Boolean
' Call our convert function
' Please note the last param signals whether to perform
' font embedding or not. I have turned font embedding ON for this example.
blRet = ConvertReportToPDF("ImagesReportEmail", vbNullString, _
"ImagesReportEmail.Value" & ".pdf", False, True, 0, "", "", 0, 0)
(much thanks to those who helped me modify this code). The code is like this so that I can create a pdf of the current record (for emailing purposes).
There are two problems. When I hit the button which runs the code, a parameter dialog box appears (wanting the user to enter the Catalogue# of the desired record. This, by the way, is my primary key.) Unfortunately, I only figured out on my own that the Catalogue# is to be entered here as the dialog box itself does not tell you this, but instead displays the current record's catalogue#. While I would like the parameter dialog box to disappear, it is not totally completely neccessary. However, at least I would like to change the message displayed in the box so that the user will at least know what to enter! From what I've gathered this means changing the criteria -- but when I try to do this in the query, it reverses back to the Catalogue# for the current record.
Also, I am having some issues with another report which I am trying to print off as pdf for the current record. I basically copied and pasted the same code (which works!) for the ImagesReport and made the appropriate changes so that it looks to a different form and outputs a different report. But, when I click on the button to start the event, the parameter value box comes up again, but this time, for all the fields in the table (not just the primary key). And, if I just hit enter to all of the prompts, it opens up the pdf for the current record, but it copies out the same record 3 times over? I am completely confused as to why this is happening! Please help!
I am using Leban's Report2PDF code, modified as such:
Private Sub cmdMail_Click()
Dim qdf As DAO.QueryDef
'Set query to be the current record
With CurrentDb
Set qdf = .QueryDefs("Images Query")
qdf.SQL = "SELECT * FROM Images WHERE [Catalogue#]=" & Me.[Catalogue#]
qdf.Close
Set qdf = Nothing
End With
' create PDF from report using the query that was modified above
Dim blRet As Boolean
' Call our convert function
' Please note the last param signals whether to perform
' font embedding or not. I have turned font embedding ON for this example.
blRet = ConvertReportToPDF("ImagesReportEmail", vbNullString, _
"ImagesReportEmail.Value" & ".pdf", False, True, 0, "", "", 0, 0)
(much thanks to those who helped me modify this code). The code is like this so that I can create a pdf of the current record (for emailing purposes).
There are two problems. When I hit the button which runs the code, a parameter dialog box appears (wanting the user to enter the Catalogue# of the desired record. This, by the way, is my primary key.) Unfortunately, I only figured out on my own that the Catalogue# is to be entered here as the dialog box itself does not tell you this, but instead displays the current record's catalogue#. While I would like the parameter dialog box to disappear, it is not totally completely neccessary. However, at least I would like to change the message displayed in the box so that the user will at least know what to enter! From what I've gathered this means changing the criteria -- but when I try to do this in the query, it reverses back to the Catalogue# for the current record.
Also, I am having some issues with another report which I am trying to print off as pdf for the current record. I basically copied and pasted the same code (which works!) for the ImagesReport and made the appropriate changes so that it looks to a different form and outputs a different report. But, when I click on the button to start the event, the parameter value box comes up again, but this time, for all the fields in the table (not just the primary key). And, if I just hit enter to all of the prompts, it opens up the pdf for the current record, but it copies out the same record 3 times over? I am completely confused as to why this is happening! Please help!