Export single record from a form to PDF

I am having trouble exporting single records from a form to pdf.
I have the following code so far. but it gives:

Run time error 3464
Data type mismatch in criteria expression.

Debug highlights:
Me.RecordSource = "Select * From Propertyextract Where [propref] = " & _

Private Sub cmdExportPDF_Click() Dim MyDB As DAO.Database
Dim MyRS As DAO.Recordset
Dim strSQL As String
strSQL = "Select Propertyextract.[propref] From Propertyextract;"
Set MyDB = CurrentDb
Set MyRS = MyDB.OpenRecordset(strSQL, dbOpenForwardOnly)
With MyRS
Do While Not MyRS.EOF
Me.RecordSource = "Select * From Propertyextract Where [propref] = " & _
DoCmd.OutputTo acOutputForm, "FrmPropertyAttributes", acFormatPDF, "" & ![propref] & ".pdf"
End With
Set MyRS = Nothing End Sub

Sponsored Links:

Related Topics

Export Single Record
Is there a way to export a single record from an Access 2007 form? It can be exported to Excel or as a PDF or text file. For example if my data source has 100 records I just want to export record 5. If I need to explain this further just let me know.

Form export to PDF with linked images
Using Access 2007 I have a form that works perfectly with "on Current" event using

Private Sub Form_Current()
Image.Picture = ProductPicture
End Sub

This routine uses the linked jpg ProductPicture file to display the relevant product picture for each record in the table.

My issue is that when I try to export the form as a PDF all the records come over into the report but the picture doesn't change with the change of each record. The first image is repeated for each table record.

Export Datasheet to Pdf with a caption
I have a specific datasheet form that I export to Pdf format. How can I get the Datasheet title to display at the top of my pdf document?

Display pdf attachment in report
I have a table that contains data pertinent to parts which are manufactured. For each record I have a part number, revision, manufacturer etc. I also have an attachment dataset which contains a single pdf.

I would like to generate a report that has one record per page and displays the pdf attachment.

Generating and formatting the report is no problem, but my pdf attachment only shows up as the acrobat icon.

my vba is pretty weak. If there is a better way of going about printing pdf attachments I am open to suggestions.

Exporting Reports Question
-Access 2007
-Adobe Acrobat 8 Professional

Currently our users are exporting reports one-by-one and then combining them after to a single pdf for printing.

Is there a way to export multiple reports to a single pdf file from Access?

export single access record
is it possible to export through vba a single record and add it to the next blank line in excel

Export to PDF Document Format
Contrasting to Access 2007, in which you need to install add-ins to export database. Access 2010 offers option of exporting database in PDF (Portable Document Format) and XPS (XML paper Specification) formats. Now with Access 2010, you can export datasheet, Forms and Reports to a .pdf or .xps file, it enables you to spread information in an easy-to -distribute form that contains all formatting characteristics.

Multiple Reports to Single PDF
I am working on a database for my company in Access right now and one of the Forms that I have created can generate a single PDF file based on a report. I would rather have this done another way though.

I want a user to be able to select multiple checkboxes on the form, which will determine what reports the user needs. The next thing that it will need to do is take all these reports and generate a single PDF containing each one of these selected checkboxes.

Automatically name a report when exporting to PDF
I have a form with a command button that opens my report in print preview mode in Access 2007. When I click the Export to PDF/XPS button, the default file name is the name of the actual report within Access. I've used VBA to change the report caption to match a field on my form called PROGRAM. However, this does not transfer over when I want to save my report to pdf.

How can I make it so that when I click export to pdf/xps, the default file name is named after a text box called PROGRAM?

MACRO for emailing a single record
me please. I am very new to Access

I have created a database for recording Quality issues from various customers. I have also created a FORM for ease of entry of data. What I want to do is create a BUTTON for this FORM that when clicked will create a PDF of the current record only and attach it to an email. I have tried to use the SendObject action and have set up the email side of things but the problem I have is that the PDF that has been created has ALL of the records listed in it and not a singular record.

I suppose a macro similar to PRINT RECORD would be required.

Would this be able to be done as a macro or would VB be required?

I hope to hear from someone soon

Link PDF files
What would be the best way to link pdf files in an Access database form?

For each record there could be more then one pdf file. I would like to automate the process as much as possible. The pdf file would exist on a network drive and the user would need to go to their record in Access and then link the pdf files.

I started but am having problems with Access not opening the pdf file, it will open word files but not pdf,

Exporting to PDF via VBA Causing Database Corruption
I have a database that I have built that needs to export a large set of data to PDF for each county in Florida. If I manually export of these (without VBA code) to PDF, they work fine and my database does not go corrupt.

If I leave the code in VBA to export any county under 50,000KB, they all work perfect and the database does not corrupt. However, I have one relatively large PDF exports at 166,708KB.

As soon as I run the code to export this PDF file (and compact and repair my database thereafter) I get a error message upon re-opening the database stating that my VBA code is corrupt.

It then prompts me through some more error messages and it ends up erasing VBA code and any objects with VBA code attached. I'm just curious as to the reason why this file size is leading to a database corruption when it's coded into VBA.

Export to .pdf with default name
I would like to export a report to PDF format. However, I don't want to use the report name as the default file name. Is it possible to do that?

Report Name: Report1
Desired .pdf name: PDFFile

Here is the code I am using, but when you do save it the file name defaults to Report1

DoCmd.OutputTo acOutputReport, "Report1", "PDF Format (*.pdf)", "", False, "", 0, acExportQualityPrint

How do I export multiple queries ?
I have codes for export that looks like this
and This above code export were only able to export one single query/table.

I would like to export more queries to one single excel when I am exporting. What should I add to my codes to make that happen?

GO TO buttons on form
I have two forms based on a single table. One shows a list of records (with a few fields), the other in a single record with several fields. I'd like to create a button on each line of the record list form that will open the individual record on the single record input form. Also would like to have a button on the single record that would take me back to the list form

GO TO buttons on form
I have two forms based on a single table. One shows a list of records (with a few fields), the other in a single record with several fields. I'd like to create a button on each line of the record list form that will open the individual record on the single record input form.

Also would like to have a button on the single record that would take me back to the list form.)

Save Form In PDF Format
Unlike previous versions, Access 2010 offers a direct way to publish reports and forms in widely used document publishing format – PDF. Once you’ve done creating your forms in Access 2010, you can export the form into PDF and XPS format

Save to PDF Button?
For the final step of my purchase order program/form, I need a button that saves the form to a .PDF file. I don't want it to save as a new record, just have it go and save as a .PDF. When I would click the button, it would save just the form to a .PDF and it would come up with the window where you would select your save location.

What would be the event/code to be able to do this

Exporting Report to a word file or PDF or whatever
I get there is a button by the wizard that can make me export a report to ms word. Its quite cool but what I want to do is to ecport a report top ms word for a single record by this button.how do I code it

Small Project - Contractor Needed - Merge Access Data To PDF Form
I have a standard access database with customer records.
I have some PDF forms (to start with 3 forms).

I wish to create a facility that once my users navigate to a particular customers record, they can then merge that particular record to one of the three PDF forms.I am not conversant with VB, so I am happy to pay someone to create this functionality.

We are using Access 2007 and standard PDF forms.I am attaching one of the PDF forms for you to have a look. I will also supply a word document which outlines which field in my database pairs up with which field on the form.