Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Create Pdf Viewer in Access 2003

Posted on 2006-10-30
1
298 Views
Last Modified: 2012-06-22
Access 2003
adobe reader 6.0 +

What I have:
form called frmViewer
C:\PDF_Pages\    Dir with pdf files.
0001.pdf
0002.pdf    <--- correspond to Page numbers
etc.....

One Table
tblData
2 fields
fldData
fldPageNumber

Example:
Data          PageNumber
6CA60        0033
5AW23       1300
etc

On the form:
tblData --  Bound
One Textbox
txtLookUp  fldData
One Listbox
lstChoice   PageNumber

What I need:
I want to be able to type in the txtLookUp and the corresponding Page number will show Up in the lstChoice.

Then doubleclick on the lstChoice and the  pdf file from the dir of pdf files  will open up..


Example:
So if I'am looking for aan Item:
I type in    6CA60  and Page   0033 come up the listbox
I doubleclick on  0033 and the  0033.pdf file from the   C:\PDF_Pages\  
will open up

Thanks
fordraiders

 










0
Comment
Question by:fordraiders
1 Comment
 
LVL 65

Accepted Solution

by:
rockiroads earned 500 total points
ID: 17834972
Howdo mate :)

Try this


on the afterupdate of txtLookup u want listbox populated

private sub txtLookup_AfterUpdate()
    lstChoice.RowSource = "SELECT PageNumber FROM tblData WHERE fldData = '" & Me.txtLookup & "'"
end sub



then on the click event, of the listbox, u want to show the PDF
Now we can do this one of two ways
U can open up PDF or create a viewer within your form

'Open up PDF

private sub lstChoice_DblClick()
    Dim sFile as String

    sFile = "C:\PDF_Pages\" & lstChoice.Value
    if dir$(sfile) <> "" then followhyperlink sFile else msgbox "File not found"
end sub


'Using viewe on form

on a form, add the following active x control

Adobe Acrobat Control for ActiveX

u may need to resize it to a larger size

Say its called pdf0

Now in code, u load a pdf using this syntax

Pdf0.LoadFile "full path of file"   e.g.   Pdf0.LoadFile "C:\EE\xx1.pdf"


so in your case

private sub lstChoice_DblClick()
    Dim sFile as String

    sFile = "C:\PDF_Pages\" & lstChoice.Value
    if dir$(sfile) <> "" then pdf0.loadfile sFile else msgbox "File not found"
end sub

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access 2010 change CurrentUser 5 34
set focus to tabbed sub form 10 39
Issues deleting large files via Access 2010 and VBA 7 20
Access Web App or PowerApp 24 36
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question