open folder containing data for the same country

M

mhmaid

Hi
I am trying to do the following
my job is to receive and account the Patients bills which comes to me from
diff countries

and I have to keep a copy for the office
now , we want to stop taking copies , and instead , I should scan the
documents and save as pdf files
and according to the instructions from my boss, i have created a folder
"invoices" and in this folder I have created many folders with there names as
counties names ie."usa","united kingdom","germany",etc

folder is kept in drive d
D:\invoices\

i have a form called "invoice register" where i have to enter the invoice
details including name of the country of treatment
for each record , the key is Batchid "auto number"
each pdf file , represents a scanned copy of invoices for one batchid

now i wanted to create a button , when clicked to open the file that has the
same batchid

example
suppose the batchid number is 4433
and the country for this is usa
then
i want access to find the folder named "usa" and in that folder it should
open the pdf document named 4433

appreciate your help
 
D

Daniel Pineault

Create a button and for the on_click event try something like:

Application.FollowHyperlink "D:\invoices\" & [countryFormControlName] & "\"
& [batchidFormControlName] & ".pdf"
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
M

Mark Andrews

Or same approach with the shell function:

Option Compare Database
Option Explicit

Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hWnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Public Function OpenDoc(ByVal DocFile As String) As Long
OpenDoc = ShellExecute(0&, vbNullString, DocFile, vbNullString,
vbNullString, vbNormalFocus)
End Function


--
Mark Andrews
RPT Software
http://www.rptsoftware.com
http://www.donationmanagementsoftware.com

Daniel Pineault said:
Create a button and for the on_click event try something like:

Application.FollowHyperlink "D:\invoices\" & [countryFormControlName] &
"\"
& [batchidFormControlName] & ".pdf"
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



mhmaid said:
Hi
I am trying to do the following
my job is to receive and account the Patients bills which comes to me
from
diff countries

and I have to keep a copy for the office
now , we want to stop taking copies , and instead , I should scan the
documents and save as pdf files
and according to the instructions from my boss, i have created a folder
"invoices" and in this folder I have created many folders with there
names as
counties names ie."usa","united kingdom","germany",etc

folder is kept in drive d
D:\invoices\

i have a form called "invoice register" where i have to enter the invoice
details including name of the country of treatment
for each record , the key is Batchid "auto number"
each pdf file , represents a scanned copy of invoices for one batchid

now i wanted to create a button , when clicked to open the file that has
the
same batchid

example
suppose the batchid number is 4433
and the country for this is usa
then
i want access to find the folder named "usa" and in that folder it should
open the pdf document named 4433

appreciate your help
 
M

mhmaid

thank you very much for helping
I have tried this and its doing the job
thanks again

Daniel Pineault said:
Create a button and for the on_click event try something like:

Application.FollowHyperlink "D:\invoices\" & [countryFormControlName] & "\"
& [batchidFormControlName] & ".pdf"
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



mhmaid said:
Hi
I am trying to do the following
my job is to receive and account the Patients bills which comes to me from
diff countries

and I have to keep a copy for the office
now , we want to stop taking copies , and instead , I should scan the
documents and save as pdf files
and according to the instructions from my boss, i have created a folder
"invoices" and in this folder I have created many folders with there names as
counties names ie."usa","united kingdom","germany",etc

folder is kept in drive d
D:\invoices\

i have a form called "invoice register" where i have to enter the invoice
details including name of the country of treatment
for each record , the key is Batchid "auto number"
each pdf file , represents a scanned copy of invoices for one batchid

now i wanted to create a button , when clicked to open the file that has the
same batchid

example
suppose the batchid number is 4433
and the country for this is usa
then
i want access to find the folder named "usa" and in that folder it should
open the pdf document named 4433

appreciate your help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top