Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Create Pdf Viewer in Access 2003

Posted on 2006-10-30
1
Medium Priority
?
303 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
[X]
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
1 Comment
 
LVL 65

Accepted Solution

by:
rockiroads earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

719 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