Open a document through Access

G

Guest

Is it possible to open a document (word, pdf, etc) from an acces databse form
where a field on the form has a corresponding ID to a document stored in a
partcular network folder.

Example.
Form named "frmScannedRequests" displays a record where one of the 12 fields
in the record is named "TransactionID" (auto number generated when record is
created). The record represents a request for a document that is scanned into
a folder.

At "C:\\Documents And Settings\All Users\Scanned Documents" sits a PDF file
that has been given a name that directly corresponds to the "TransactionID"
number.

Is there a way to allow the user to double click the "TransactionID" field"
(they user will know the document is ready for viewing because the individual
doing the scanning will update a field in the record) and then the
corresponding PDF file in the storage folder opens up displaying the document?
 
F

fredg

Is it possible to open a document (word, pdf, etc) from an acces databse form
where a field on the form has a corresponding ID to a document stored in a
partcular network folder.

Example.
Form named "frmScannedRequests" displays a record where one of the 12 fields
in the record is named "TransactionID" (auto number generated when record is
created). The record represents a request for a document that is scanned into
a folder.

At "C:\\Documents And Settings\All Users\Scanned Documents" sits a PDF file
that has been given a name that directly corresponds to the "TransactionID"
number.

Is there a way to allow the user to double click the "TransactionID" field"
(they user will know the document is ready for viewing because the individual
doing the scanning will update a field in the record) and then the
corresponding PDF file in the storage folder opens up displaying the document?

Look up the FollowHyperlink methon=d in VBA help.

Application FollowHyperlink "C:\\Documents And Settings\All
Users\Scanned Documents\" & [TransactonID]

Assuming the actual name of the document is whatever is stored in the
[TransactionID] field.
 
G

Guest

Thanks for responding.

When I insert the code into the double click event I get an error message
saying,

Run Time Error 490
Cannot open the specified file.

This is what I pasted into the event:

Private Sub tblBOTracking_TransactionNumber_DblClick(Cancel As Integer)

Application.FollowHyperlink "C:\\Scanned Docs\" & [AccountNumber]

End Sub



fredg said:
Is it possible to open a document (word, pdf, etc) from an acces databse form
where a field on the form has a corresponding ID to a document stored in a
partcular network folder.

Example.
Form named "frmScannedRequests" displays a record where one of the 12 fields
in the record is named "TransactionID" (auto number generated when record is
created). The record represents a request for a document that is scanned into
a folder.

At "C:\\Documents And Settings\All Users\Scanned Documents" sits a PDF file
that has been given a name that directly corresponds to the "TransactionID"
number.

Is there a way to allow the user to double click the "TransactionID" field"
(they user will know the document is ready for viewing because the individual
doing the scanning will update a field in the record) and then the
corresponding PDF file in the storage folder opens up displaying the document?

Look up the FollowHyperlink methon=d in VBA help.

Application FollowHyperlink "C:\\Documents And Settings\All
Users\Scanned Documents\" & [TransactonID]

Assuming the actual name of the document is whatever is stored in the
[TransactionID] field.
 
G

Guest

I think I figured it out.

Private Sub tblBOTracking_TransactionNumber_DblClick(Cancel As Integer)
On Error GoTo Err_tblBOTracking_TransactionNumber_DblClick

Application.FollowHyperlink "C:\\Scanned Docs\" & [AccountNumber] & ".pdf"

Exit_tblBOTracking_TransactionNumber_DblClick:
Exit Sub

Err_tblBOTracking_TransactionNumber_DblClick:
MsgBox Err.Description
Resume Exit_tblBOTracking_TransactionNumber_DblClick

End Sub

Thank you so much for the help Fred.

Antonio


Antonio said:
Thanks for responding.

When I insert the code into the double click event I get an error message
saying,

Run Time Error 490
Cannot open the specified file.

This is what I pasted into the event:

Private Sub tblBOTracking_TransactionNumber_DblClick(Cancel As Integer)

Application.FollowHyperlink "C:\\Scanned Docs\" & [AccountNumber]

End Sub



fredg said:
Is it possible to open a document (word, pdf, etc) from an acces databse form
where a field on the form has a corresponding ID to a document stored in a
partcular network folder.

Example.
Form named "frmScannedRequests" displays a record where one of the 12 fields
in the record is named "TransactionID" (auto number generated when record is
created). The record represents a request for a document that is scanned into
a folder.

At "C:\\Documents And Settings\All Users\Scanned Documents" sits a PDF file
that has been given a name that directly corresponds to the "TransactionID"
number.

Is there a way to allow the user to double click the "TransactionID" field"
(they user will know the document is ready for viewing because the individual
doing the scanning will update a field in the record) and then the
corresponding PDF file in the storage folder opens up displaying the document?

Look up the FollowHyperlink methon=d in VBA help.

Application FollowHyperlink "C:\\Documents And Settings\All
Users\Scanned Documents\" & [TransactonID]

Assuming the actual name of the document is whatever is stored in the
[TransactionID] field.
 
F

fredg

Thanks for responding.

When I insert the code into the double click event I get an error message
saying,

Run Time Error 490
Cannot open the specified file.

This is what I pasted into the event:

Private Sub tblBOTracking_TransactionNumber_DblClick(Cancel As Integer)

Application.FollowHyperlink "C:\\Scanned Docs\" & [AccountNumber]

End Sub

fredg said:
Is it possible to open a document (word, pdf, etc) from an acces databse form
where a field on the form has a corresponding ID to a document stored in a
partcular network folder.

Example.
Form named "frmScannedRequests" displays a record where one of the 12 fields
in the record is named "TransactionID" (auto number generated when record is
created). The record represents a request for a document that is scanned into
a folder.

At "C:\\Documents And Settings\All Users\Scanned Documents" sits a PDF file
that has been given a name that directly corresponds to the "TransactionID"
number.

Is there a way to allow the user to double click the "TransactionID" field"
(they user will know the document is ready for viewing because the individual
doing the scanning will update a field in the record) and then the
corresponding PDF file in the storage folder opens up displaying the document?

Look up the FollowHyperlink methon=d in VBA help.

Application FollowHyperlink "C:\\Documents And Settings\All
Users\Scanned Documents\" & [TransactonID]

Assuming the actual name of the document is whatever is stored in the
[TransactionID] field.

I just copied and pasted your folder location. I should have read it
first. :-(
There is an extra "\" in your path line.

Try:
Application.FollowHyperlink "C:\Scanned Docs\" & [AccountNumber]

Or is it
"C:\Documents And Settings\All Users\Scanned Documents" &
[AccountNumber]

Make sure [Account number] contaions the file name and extension, i.e.
"FileName.pdf" or "FileName.doc", etc.
 
G

Guest

Thanks Fred, it has helped tremendously.

fredg said:
Thanks for responding.

When I insert the code into the double click event I get an error message
saying,

Run Time Error 490
Cannot open the specified file.

This is what I pasted into the event:

Private Sub tblBOTracking_TransactionNumber_DblClick(Cancel As Integer)

Application.FollowHyperlink "C:\\Scanned Docs\" & [AccountNumber]

End Sub

fredg said:
On Wed, 8 Aug 2007 21:06:02 -0700, Antonio wrote:

Is it possible to open a document (word, pdf, etc) from an acces databse form
where a field on the form has a corresponding ID to a document stored in a
partcular network folder.

Example.
Form named "frmScannedRequests" displays a record where one of the 12 fields
in the record is named "TransactionID" (auto number generated when record is
created). The record represents a request for a document that is scanned into
a folder.

At "C:\\Documents And Settings\All Users\Scanned Documents" sits a PDF file
that has been given a name that directly corresponds to the "TransactionID"
number.

Is there a way to allow the user to double click the "TransactionID" field"
(they user will know the document is ready for viewing because the individual
doing the scanning will update a field in the record) and then the
corresponding PDF file in the storage folder opens up displaying the document?

Look up the FollowHyperlink methon=d in VBA help.

Application FollowHyperlink "C:\\Documents And Settings\All
Users\Scanned Documents\" & [TransactonID]

Assuming the actual name of the document is whatever is stored in the
[TransactionID] field.

I just copied and pasted your folder location. I should have read it
first. :-(
There is an extra "\" in your path line.

Try:
Application.FollowHyperlink "C:\Scanned Docs\" & [AccountNumber]

Or is it
"C:\Documents And Settings\All Users\Scanned Documents" &
[AccountNumber]

Make sure [Account number] contaions the file name and extension, i.e.
"FileName.pdf" or "FileName.doc", etc.
 

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