Output individual records as PDF files

Anonymous
2019-10-29T19:10:56+00:00

My organization is using MS Word form to create a client questionnaire. Each Word doc form is saved as PDF file and stored in the Client's folder. I created a form in Access to capture and parse the questions but I cannot find a way to create and output a PDF file from Access. This requires me to repeat the entry process manually into the Word document.  My IT department won't let me roll this out to other employees because of A) the double entry issue and B) they fear other users apparently will have to learn and use VBA to output individual records.

My question is: Can Access output individual records as a printable PDF format and cannot it be done without VBA?

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2019-12-04T04:17:58+00:00

I can answer the one question...  You can set two Primary Keys by highlighting both rows and then pressing Primary Key.

Was this answer helpful?

0 comments No comments
Answer accepted by question author
Anonymous
2019-11-21T22:31:42+00:00

David,

Me <--no degree in Computer Science.

I did have a great teacher who was a co-worker.  I learned a lot for her but more from the great help I received in newsgroups as there were no forums at the time.  If I were a beginner now I would start with Crystal's book which is free...

http://allenbrowne.com/casu-22.html

You can also go here for free Data models...

http://www.databaseanswers.org/data_models/

https://www.access-diva.com/tips.html#bmDataModels

Access is simple enough for non-technical Users but once you start getting *serious* you do need to do some reading.  And those hundreds of hours are over time with the help of the many Forums where free help is given including helping you create a data model.  So if you ever decide it's worth the time, we are here to help.

I also noticed you said you created a Form and tried to add fields from another table which sounded like it was unrelated to the record source of the Form.  Well, this can only be done when table is part of the record source.  You can create a query which can include multiple tables from which you need fields and build your form though most would just use a subform in a typical one-to-many scenario.

Was this answer helpful?

0 comments No comments

64 additional answers

Sort by: Newest
  1. Anonymous
    2019-10-30T23:02:24+00:00

    The main database/survey I'm attempting to build requires 86 questions that won't fit into a single form.

    That is not how questionnaire databases are structured.  In a relational database questions and answers are each an entity type, and therefore modelled by separate tables in which each question is represented by a row in one table, and each answer by a row in another.  The relationship type between questions and answered is modelled by a further table, to which is related another table modelling the responses relationship type.  The image below is of the model for my Questionnaire demo file which you'll find in my public databases folder at:

    https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2019-10-30T22:42:51+00:00

    Thanks for the info but I realize that Access may not work for my purposes. The main database/survey I'm attempting to build requires 86 questions that won't fit into a single form. I did create sub-forms by breaking down the survey into 9 sections / tabs. While the sub forms/tabs feed the Table, the Query from the table and the Report generated from that is too large and cannot be formatted for PDF output. And it also creates duplicate data rendering it useless. (I tried several times from scratch and keep getting the duplicates so, obviously I need VAB code to prevent this but I haven't the faintest idea even how to begin - let alone the colossal waste of time experimenting via trial and error. And while I am venting, a software program should not force it's user to create multiple re-iterations to achieve a desired outcome. One may as well use Visual Basic Studio to build from the ground up instead of Access. 

    Unfortunately, my schedule is far too demanding to learn and apply VBA, a 28 year old language that is well on its way of becoming obsolete. Plus, I need a database that allows multiple users in a web environment. Access is really for single users on dedicated machines. It is not a reliable solution in a shared environment.  Investing my time into a decades old JET platform with limited storage capacity with an end of life Web apps that occurred last year is not a good use of my time. 

    By the way, in less than two hours, I was able to build exactly what I wanted on a DOM drag and drop platform and was able to export a PDF and a Onenote file from the DOM database. It's a very cool system that allows customization via Javascript.  Check out Kintone. It is a modern platform light years ahead of Access. 

    I am optimistic that my organization will adopt this platform soon. 

    DC

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2019-10-30T18:03:33+00:00

    I just really want to print from a record to a PDF file and I enter the record.............

    In Access the way to do that is not to print the form, but to output a report to a PDF file.  The report can, as in the demo to which I referred you, be output restricted to the form's current record.  First you need to design the report, but that's a simple task, and the report wizard can be used if you wish.  The report should be based on a query which references whatever is the primary key which identifies each records as a parameter.  In my demo it's the invoice number.

    The code in my demo is mostly concerned with building the path to the folder where the PDF file is to be saved, and the name of the file, but if you are saving the file to an existing client's folder, then the code can be quite simple.  Let's assume for simplicity that you have a folder on the system named F:\Clients\ with a subfolder for each client with a distinct ClientName value as the name of each subfolder, and that the primary key identifying each record is named ClientID, and the table includes a column (field) named ClientName whose values are exactly the same as the subfolder names.  The code in the Click event procedure of a button on the form would be like this:

        Const REPORT_NAME = "rptClientQuestionnaire"

        Const PARENT_FOLDER = "F:\Clients"

        Dim strPath As String

        strPath = PARENT_FOLDER & Me.ClientName & "" & Me.ClientName & "  Questionnaire.PDF"

        ' ensure current record is saved

        Me.Dirty = False

        ' output report to a PDF file in client's folder

        DoCmd.OutputTo acOutputReport, REPORT_NAME, acFormatPDF, strPath, True

    As well as saving the PDF file this code will also open it, which acts as confirmation to the user.

    The query used as the report's RecordSource property would be like this:

    PARAMETERS Forms!frmQuestionnaire!ClientID LONG;

    SELECT *

    FROM ClientQuestionnaires

    WHERE ClientID = Forms!frmQuestionnaire!ClientID

    where ClientQuestionnaires is the name of the table to which the form named frmQuestionnaire is bound.

    Once you've set the form and report up as described above, all an employee has to do to save the current record as a PDF file is click the button.  They have no need to be aware of any of the code which does the work behind the scenes.

    If you are unfamiliar with entering code into a form's, report's, report section's  or control's event procedures, this is how it's done in form or report design view:

    1.  Select the form, report, section or control as appropriate and open its properties sheet if it's not already open.

    2.  Select the relevant event property in the Event tab, and select the 'build' button (the one on the right with 3 dots).

    3.  Select Code Builder in the dialogue and click OK.  This step won't be necessary if you've set up Access to use event procedures by default.

    4.  The VBA editor window will open at the event procedure with the first and last lines already in place.  Enter or paste in the code as new line(s) between these.

    Was this answer helpful?

    0 comments No comments