Results 1 to 6 of 6
  1. #1
    steveo0707 is offline Novice
    Windows 11 Office 365
    Join Date
    Oct 2023
    Posts
    16

    Fill in PDF From Access

    I have a Access Form that we enter Data into tracking our non-conforming parts (NCMR). I have the code opening up the form and starting in the correct field, however, it is not transferring the data as I hoped. The Database is too large to share. I will attach photos of the pertinent information relating to the database. If I miss anything, please let me know.

    Code:
    Private Sub SendData(S As Variant)
    
        If IsNull(S) Or S = "" Then S = " "
    
    
        SendKeys S & "{TAB}", True
        Sleep 300
        
    End Sub

    Code:
    Private Sub FillInPDFBtn_Click()
         
         ' Hyperlink
        
            FollowHyperlink "Y:/ISO WEB/Level IV/Quality/Q-220.pdf"
            
            Sleep 1000 'wait for PDF to Load
                 
        ' Fill in Fields
        
            SendData NCMRNumber
            SendData PageNumber
            SendData OfNumber
            SendData NCMRType
            SendData InitiatedDate
            SendData ProductFamily
    
    
    End Sub
    Click image for larger version. 

Name:	N NCMR Number.png 
Views:	26 
Size:	18.5 KB 
ID:	51078



    Click image for larger version. 

Name:	Input Table.png 
Views:	26 
Size:	84.0 KB 
ID:	51079

    Click image for larger version. 

Name:	Main Table.jpg 
Views:	26 
Size:	138.5 KB 
ID:	51080

    Click image for larger version. 

Name:	NCMR Main Table Form View.png 
Views:	26 
Size:	32.1 KB 
ID:	51081

    Any Help would be greatly appreciated.

  2. #2
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Hi Steve
    Welcome to the Forum
    Looking at your Forms & Table it looks like you have a number of Repeating Groups ie
    Discrepancy 2
    Discrepancy 2 Qty
    Discrepancy 3
    Discrepancy 3 Qty
    Discrepancy 4
    Discrepancy 4 Qty
    Discrepancy 5
    Discrepancy 5 Qty

    The same applies to Disposition and Causes.

    All of these fields should be Records in related separate Tables.
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    While true, I don't see any proof that is the cause of whatever issue being experience. SendKeys is temperamental and should be avoided when possible.
    This is too vague
    however, it is not transferring the data as I hoped.
    Are you trying to insert data into an existing pdf form? It's not that simple. AFAIK, you would need to find and download the Adobe library for VBA and learn how to use it. The typical approach in VBA is to create a pdf from a report.

    I kinda doubt you're going to recreate your db, but as noted, it's build like a spreadsheet, not a relational db. I don't see any primary key in that table property sheet either, which at some point will likely come back to bite you.

    As for attaching db's here, copying/compacting/zipping usually gets the size down enough. See "How to Attach Files" at the top of the page if you need help with uploading anything here.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Never transferred data to a PDF so going in blind but what is it not doing, is it not transferring any data at all or putting data in the wrong fields on the PDF?
    Few things, you have a pause to load the PDF, what it if is not long enough? Looks like you are using <tab> to move to next field, is that tab order correct on the form? Are you keeping the focus on the form?

  5. #5
    steveo0707 is offline Novice
    Windows 11 Office 365
    Join Date
    Oct 2023
    Posts
    16
    It is opening the PDF and is starting in the correct Position (NCMR), it just isn't sending the data at all. I have attached a zipped file of the database.
    Attached Files Attached Files

  6. #6
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Hi Steve
    The attached is just a shortcut to the Db and not the actual database?
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

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

Similar Threads

  1. Access equivalent of Approach Fill Field
    By tagteam in forum Access
    Replies: 3
    Last Post: 09-23-2013, 03:42 PM
  2. Auto Fill a field? Access 2007
    By ldybugs4me in forum Database Design
    Replies: 1
    Last Post: 03-07-2013, 02:21 PM
  3. fill online forms using Access
    By live2ride in forum Access
    Replies: 22
    Last Post: 11-08-2012, 11:25 AM
  4. Access to Word Form Fill
    By defy in forum Programming
    Replies: 1
    Last Post: 10-04-2011, 12:10 AM
  5. PDF form to fill Access Database
    By chadjray in forum Import/Export Data
    Replies: 0
    Last Post: 03-21-2011, 04:01 PM

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