Open a word file from a form

gmingtian

New member
Local time
Today, 04:10
Joined
Sep 26, 2007
Messages
3
:) Hi, I am new to VBA and need some help where to beging for one thing I want to do:
1. I want to open a word document from one click on one button on the form.
2. The word doc is named as ID.doc, or ID.pdf, ID being the primary key automatically assigned when the record is entered into the database.
3. The word docs are saved in the same folder where the database is. Users have to be granted access to this folder.

Basically this is a resume database, when a person is brought up in the form, the user needs to click one button to open the resume.

Thanks a lot!!
gmt
 
check the samples on this - someone has done this already
 
Do you mean the sample code posted by "jiminic"? The below part in the code kind of throw me off:

"C:\Program Files\Microsoft Office\Office10\WINWORD.EXE N:\SMDiv\Insurance\MemberRelations\FileManagement\ SystemReferrals\" & Forms![SystemReferralActionFrm]![SystemReferralTbl.JobNumber] & ".doc"

Is this the part that to tell Access to look for the file name?
 
Got the answer

I got this line of code from someone else, thought I would share here:

Application.FollowHyperlink CurrentProject.Path & "\" & Me.ID & ".doc"

I put this in the form as a Private Sub, OnClick. It assumes that the word document has a file name that correspond to the ID field in the form.
 

Users who are viewing this thread

Back
Top Bottom