Question

  • Thread starter Thread starter l_bax
  • Start date Start date
L

l_bax

I have a folder (d:\Purchase Orders) in which I scan and store all
documents (Purchse Order, Material Request, Vendor Quote, Vendor
Invoice, etc) related to a Purchase Order (d:\Purchase Orders). I have
this because I am required to store the documents after all signatures
have been obtained. All the individual documents are scanned into one
PDF file with the PO Number as the name of the file. I have an Access
2003 database that I utilize to track all the PO information (PO_No,
Date, Item, Cost, etc.). I use a form Add/Edit PO. What I would like
to do is to create a command button on the form that would take me to
D:\Purchase Orders. I could then open the individual PO file and view
or print the PO if I needed to. I've looked at using a Macro but so
far have been able to get it to work. Any suggestion would be
appreciated.

TIA

Larry
 
l_bax said:
I have a folder (d:\Purchase Orders) in which I scan and store all
documents (Purchse Order, Material Request, Vendor Quote, Vendor
Invoice, etc) related to a Purchase Order (d:\Purchase Orders). I have
this because I am required to store the documents after all signatures
have been obtained. All the individual documents are scanned into one
PDF file with the PO Number as the name of the file. I have an Access
2003 database that I utilize to track all the PO information (PO_No,
Date, Item, Cost, etc.). I use a form Add/Edit PO. What I would like
to do is to create a command button on the form that would take me to
D:\Purchase Orders. I could then open the individual PO file and view
or print the PO if I needed to. I've looked at using a Macro but so
far have been able to get it to work. Any suggestion would be
appreciated.

I'd use ShellExecute to open the PDF file. Since you know the location of
the file, and the file name, it should be easy to open it directly from
Access:

http://www.mvps.org/access/api/api0018.htm

After saving that code above into a standard module, you can simply use the
following line of code in the Event Procedure for a command button:

fHandleFile("D:\Purchase Orders\" & Me.txtPONumber & ".pdf",WIN_NORMAL)

Where txtPONumber is the name of your textbox which is showing the PO Number
for that PO.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top