Results 1 to 8 of 8
  1. #1
    MrSpadMan is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    5

    Unbound Object Frame Not Updating

    Hello All,



    I am having the most frustrating experience. Arg.

    I have created a report that uses for its data source a table that has a hyperlink column. This column will contain the path of a file like "C:\Scott\Assets.pdf".

    The report has an unbound object frame that I'd like update (and print) whenever I read a new row from my table.

    My problem is no matter what I do the contents of the frame never change. It just keeps printing the first pdf from the first row of my table.

    My code in the Detail_Print event looks like this currently:

    With AttachmentFrame

    .Class = "AcroExch.Document.8"
    .OLETypeAllowed = acOLELinked
    .SourceDoc = HyperlinkFileLocation

    End With

    I have also tried setting up the object frame to use a file called 'DummyPDF.pdf'. Then in the code, taking the actual file contained in the hyperlink, overlaying it atop 'DummyPDF.pdf' and it still doesn't work. It always just prints the first pdf it encounters.

    The other odd thing is that the database is much larger that it should be - like maybe it's embedding my pdf's or something.

    Any help?

    Thanks in advance.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I have experienced that when trying to change properties of controls in report Detail format event. The event triggers once (per page rendered ?) and the property is changed based on the first record and is reflected in all records.

    I didn't even know pdf could be displayed in Access. I just did some experimenting and pdf will display in OLE but not Image control. Never tried to use OLE for dynamic display of images. Apparently object must be embedded in an OLEObject field and use a BoundObjectFrame with ControlSource property set to the OLEObject field http://office.microsoft.com/en-us/ac...spimgwinorform.

    I use jpg's and an Image control bound to text field with path\filename. That technique doesn't work with BoundObjectFrame.

    Is HyperLinkFileLocation a custom function to extract the path\filename from hyperlink?

    Interesting discussion about embedding pdf in report http://msgroups.net/microsoft.public...n-report/17450.
    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
    MrSpadMan is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    5
    Thanks for sending that post along. It seems possible from the many posts I've read but I haven't really found a solution so maybe it's not.

    No, the 'HyperLinkFileLocation' was just the control name on the report.

    So I have a client that would like to print his report along with the attached PDFs. Any ideas?

    I though I could create a PDF on the fly from the original Access report then combine it with the hyperlinked PDFs into a single PDF. Sure would like a better solution.....

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Are you aware that Hyperlink has multiple parts? Review http://www.allenbrowne.com/casu-09.html

    So using it as path\file string would require extracting from the hyperlink value.

    Yes, it is possible to export report to pdf and merge pdfs. I have done this. The code is rather complicated. Review
    https://www.accessforums.net/import-...ges-25042.html
    https://www.accessforums.net/access/...pdf-25574.html
    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.

  5. #5
    MrSpadMan is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    5
    Hi Again,

    Yes I did experiment with the 'HyperlinkPart' function but every parameter (which is supposed to return different parts of the hyperlink) always gave me the same result.

    When I print the hyperlink on the report (it's just a file path remember) it prints as "C:\Assets\Scott.pdf" and that's what I'm using to try to grab the PDF from disk.

    I have in my possession a free PDF combining program if anyone is interested. Just need to enter a command line: PDFCombine.exe "C:\PDF1.pdf", "C:\PDF2.pdf", "C:\PDF1And2.PDF" to create a single pdf.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I created a hyperlink like:
    CROWDER#C:\Temp\crowder_25-0369cont.pdf#

    This means CROWDER shows in textbox, however, the full value of textbox is: CROWDER#C:\Temp\crowder_25-0369cont.pdf#

    Then:
    HyperLinkPart(fieldname,acDisplayedValue) and HyperLinkPart(fieldname,acDisplayText) return: CROWDER
    HyperLinkPart(fieldname,acAddress) and HyperLinkPart(fieldname,acFullAddress) return: C:\Temp\crowder_25-0369cont.pdf
    HyperLinkPart(fieldname,acScreenTip) and HyperLinkPart(fieldname,acSubAddress) return: nothing

    So is this issue resolved?
    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.

  7. #7
    MrSpadMan is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    5
    VBA doesn't recognize 'Hyperlink', only 'HyperLinkPart'

    The value of my control (when I debug in VBA) is like "C:\Assets\Scott.PDF". I can even use that path to delete the actual file on disk.

    So I'm thinking that that's not my problem.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Sorry, typing error. I used HyperLinkPart in my testing. I edited previous post.

    Okay, so when I save hyperlink with the hyperlink wizard, the value of field and bound control is the full hyperlink I show in previous post.

    This is how images were supposed to be dynamic on reports before Access 2007 http://support.microsoft.com/default...%2Dus%3B285820

    I think it uses an Image control which does not seem to handle pdf and I don't know if code will work with BoundObjectFrame control.

    A nasty catch-22.
    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.

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

Similar Threads

  1. Unbound Object Frame
    By wsm_al in forum Access
    Replies: 1
    Last Post: 12-02-2011, 05:40 PM
  2. Replies: 8
    Last Post: 05-26-2011, 07:44 AM
  3. Bound Object Frame Combo sorted Results
    By kevsim in forum Programming
    Replies: 7
    Last Post: 01-08-2011, 06:30 PM
  4. Replies: 2
    Last Post: 10-18-2010, 07:53 AM
  5. Replies: 1
    Last Post: 08-05-2010, 12:11 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