Automatically opening links for lazy end users

  • Thread starter Thread starter RobertM
  • Start date Start date
R

RobertM

Hello:

I've got a database with links to PDF files in one of the
forms. I've been asked to set it up so the users can query
by a parameter that will bring up an individual link. The
problem is that I need to find out if there is a way that
the user can enter the search criteria into the query
parameter and have Access open up the link and display the
PDF file, not just display the link and have the user
duble click on it (These are some really lazy end users
I'm dealing with here) Does anyone know how I can do this?
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'd set up the query to return only the PDF's UNC (path to file) and use
a Recordset to read that UNC. Then, somehow, use the UNC in an open
file thingie (tech talk). Probably just use the Shell() function.

Air Code (DAO) - assumes query has pop-up parameter:

' Change path to your system's acrobat reader

const PATH_ACROBAT = "C:\Program Files\Acrobat 5.0\Reader\AcroRd32.exe"

dim db as dao.database
dim rs as dao.recordset
dim qd as dao.querydef

set db = currentdb
set qd = db.querydefs("query name") ' use your query name
set rs = qd.openrecordset

if not rs.eof then
shell(PATH_ACROBAT & " " & rs(0))
else
msgbox "No data satisfies your criteria"
end if

rs.close
qd.close
db.close

=====

Be sure the UNC returned by the query looks something like this:

C:\My Documents\PDF Files\myPDF_File.pdf

i.e.: drive, path, file name

====

There are other ways to do this: ComboBox to select criteria & a
ListBox that shows the PDF UNCs and a short description, that fit that
criteria. User does a single click on PDF description to open file
using SHELL() function (ListBox's OnClick event).

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQJlBZIechKqOuFEgEQIlggCg42Bu6Zo/0T6OlpzZJczqh5anB40AoNHT
CJj1nSDrxIinG6drU7XbK4em
=Iuo2
-----END PGP SIGNATURE-----
 
Back
Top