Results 1 to 3 of 3
  1. #1
    cybermonkey is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2021
    Posts
    10

    Navigation Form save as PDF

    Hello all, I may need some assistance.
    Working with an Access file, and it's designed as a navigation tabbed forms with subforms.


    A user fills out a form and it's supposed to save the filled out form as a PDF, and for the most part it works. If the form is opened and filled out, it works as intended. But when going to the form with the tabbed navigation, it saves a file proper named as per the code, but it's saving a blank PDF with only the form header.

    Here is the code when somebody clicks on the "SUBMIT" button. When the submit button is clicked, it's supposed to save the record, save the filled out form as a PDF, then have a msg box pop up confirming it has been saved and submitted and then goes to a "main window".
    But it seems like it's loading a blank form before saving it as a PDF. As stated before, if opening the form seperately it works as intended though.

    Private Sub CB_submit_Click()
    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.OutputTo acOutputForm, "Cath", _
    acFormatPDF, "FILE LOCATION AND NAME".pdf"
    MsgBox ("SAVED & SUBMITTED")
    DoCmd.BrowseTo acBrowseToForm, "Code Calls", "MainForm1.NavigationSubForm"
    End Sub

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Better to pdf a report, not form.

    By "a navigation tabbed forms" do you mean a Navigation Form or a Tab Control?

    Don't specify form name and command will just use the active form. Tested with Navigation Form and worked.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    cybermonkey is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2021
    Posts
    10
    The form itself needs to be saved for audit checks for each item entered.
    Navigation forms, it's just that the layout has tabs across the top each of those will have a different set of tabs along the left side.
    I removed the form name from that line in the code, but then it causes this error: "Run Time Error 2282: The format in which you are attempting to output the current object is not available." Which most likely means I jacked up the syntax.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 10-03-2022, 12:39 PM
  2. Replies: 11
    Last Post: 10-22-2020, 02:57 AM
  3. Replies: 2
    Last Post: 01-03-2019, 10:04 AM
  4. Replies: 5
    Last Post: 03-02-2015, 02:14 PM
  5. Replies: 5
    Last Post: 11-04-2014, 08:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums