473,396 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Open a pdf file from a button in Access

I need to be able to open a pdf file by clicking a button on a form in
Access 2000. All computers will have the latest Acrobat Reader already
installed on their network. Is there a reference to this somewhere?

dixie
Nov 13 '05 #1
4 32666
dixie wrote:
I need to be able to open a pdf file by clicking a button on a form in
Access 2000. All computers will have the latest Acrobat Reader already
installed on their network. Is there a reference to this somewhere?

dixie


A simple way would be to put the pdf file's location in the
button's HyperlinkAddress property. As long as each user has
Acrobat reader installed on their computer (I think that's what
you meant above?), clicking the button should open the file in
the reader. No code is necessary.
Search Access help for "HyperlinkAddress property" for more info.
Cheers

Nov 13 '05 #2
Thanks Helen (lover your pseudonym). That worked of course. Is there any
way to do a DLookup of the file name you want to open, as it will vary and
users are using an mde. I tried it in the HyperlinkAddress property, but it
wouldn't accept it there, so I am assuming there may be some code that can
achieve that.

dixie

"Helen Wheels" <he**********@yahoo.com.au> wrote in message
news:41**************@yahoo.com.au...
dixie wrote:
I need to be able to open a pdf file by clicking a button on a form in
Access 2000. All computers will have the latest Acrobat Reader already
installed on their network. Is there a reference to this somewhere?

dixie


A simple way would be to put the pdf file's location in the
button's HyperlinkAddress property. As long as each user has
Acrobat reader installed on their computer (I think that's what
you meant above?), clicking the button should open the file in
the reader. No code is necessary.
Search Access help for "HyperlinkAddress property" for more info.
Cheers

Nov 13 '05 #3
Take a look at using the ShellExecute API. There's a complete example at
http://www.mvps.org/access/api/api0018.htm at "The Access Web"

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"dixie" <di****@dogmail.com> wrote in message
news:uw***************@nnrp1.ozemail.com.au...
Thanks Helen (lover your pseudonym). That worked of course. Is there any
way to do a DLookup of the file name you want to open, as it will vary and
users are using an mde. I tried it in the HyperlinkAddress property, but it wouldn't accept it there, so I am assuming there may be some code that can
achieve that.

dixie

"Helen Wheels" <he**********@yahoo.com.au> wrote in message
news:41**************@yahoo.com.au...
dixie wrote:
I need to be able to open a pdf file by clicking a button on a form in
Access 2000. All computers will have the latest Acrobat Reader already installed on their network. Is there a reference to this somewhere?

dixie


A simple way would be to put the pdf file's location in the
button's HyperlinkAddress property. As long as each user has
Acrobat reader installed on their computer (I think that's what
you meant above?), clicking the button should open the file in
the reader. No code is necessary.
Search Access help for "HyperlinkAddress property" for more info.
Cheers


Nov 13 '05 #4
dixie wrote:
Thanks Helen (lover your pseudonym). That worked of course. Is there any
way to do a DLookup of the file name you want to open, as it will vary and
users are using an mde. I tried it in the HyperlinkAddress property, but it
wouldn't accept it there, so I am assuming there may be some code that can
achieve that.

dixie


What, you don't think my mother really named me that? :)

You can still use the HyperlinkAddress property, but you'll need
to use a little code to set the property at run time instead of
typing it in the form design view. Only a very little code though.

I'd create a function something like this in the form's code
module (watch out for possible word wrapping here):

Private Function set_my_link()
Me![mybutton].HyperlinkAddress = _
Nz(DLookup("[filename]", "[my_files_table]", _
"[my_files_table].[id]=" & Me![id]), "")
End Function

Then I'd decide which form events should cause the button's
hyperlink to be updated. A likely candidate would be the form's
Current event, so I'd enter this in the form's OnCurrent
property:

=set_my_link()

that should do the trick for you.

Cheers

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: William Starr Moake | last post by:
Another problem with the browser-based WYSIWYG editor I'm trying to assemble using IE's design mode. This opens the selected page in the editor iframe named iView: <select name="template"...
1
by: Jonatan | last post by:
Hi all, I'm trying to upload files doing something like gmail. I almost got it but I have a problem when I post the form. Basicaly, I am doing the following. When the user presses the link...
11
by: Grim Reaper | last post by:
I am importing a .csv file into Access that has 37 fields. My problem is that sometimes the last field only has data at the end of the column (it looks like when you import a file into Access, for...
5
by: Mr Gordonz | last post by:
Hi all, I want to put a button on a page, and when the user clicks it, the standard Windows "Open File" dialogue box opens, and the user can browse/select a file on their PC. Having selected a...
4
by: bbdobuddy | last post by:
Hi, How do I open a Microsoft Access 2003 form from Visual Basic.net Thanks in advance bbdobuddy
1
by: SAL | last post by:
Hello, Has anyone use the Open File Dialog Box in ASP.net? I know you can add the HTML File Field control to your ASP page and it will open the File Dialog Box for you. However, I would like...
5
by: Ryan Liu | last post by:
Hi, Both way works, I'd just ask some experts which way is better? My application creates a log file daily. Now each time when I write a log, I will open the file and append to the end....
4
by: nuhura01 | last post by:
Hi, I want to create an 'open file button' which will display open file dialog box for users to choose the location of folders to be read. It might be easy for Windows Application, but i want to...
4
by: nuhura01 | last post by:
Hi, I want to create an 'open file button' using asp control button, which will display open file dialog box for users to choose the location of folders to be read. It might be easy for Windows...
6
by: provor | last post by:
Hello, I have the following code that I am using when a user presses a button to import an excel file into a table. The code is hard coded to point to the correct table. This works great for this...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.