importing/linking to word file

R

Robert Painter

Good evening
Not sure if this is the correct group but.......

I have a project almost finished and wish to link to .doc files.
Basically it is a recruitment database and in the candidate form i have a
field for CV. Each candidate will submit a CV which will be stored on the
server in a file. How do i link to it please

Robert
 
T

Tom van Stiphout

On Sat, 21 Feb 2009 17:48:50 -0000, "Robert Painter"

Use a file/open dialog http://www.mvps.org/access/api/api0001.htm to
ask the user for the full path to the file. Store it in a table.
Provide a link on your form. Use FollowHyperlink to launch the editor
(presumably Word) for that document when clicked.

-Tom.
Microsoft Access MVP
 
D

Danny J. Lesandrini

You save the path to the file.

After that, you could set the hyperlink properties of the text box, but I
never liked that method. Rather, put this code in the OnClick event ...

' If text box is named txtCV then ...
strFile = Nz(Me!txtCV, "")
If Dir(strFile) <> "" Then
Application.FollowHyperlink strFile
End If
 
R

Robert Painter

Danny
Thanks for reply, The way you describe it certainly seems easier than the
api:call.
Basically I have a tblCV with CVID, CV, EmployeeIDFK and on form I have sub
frmCVsubform.
Where do i save the path to the file bearing in mind the file is on server
(n)fileemployeeCV.
Is it the txtCV on frmCVsubform i set on click () event to. ??

As you can see I am new to this and have been struggling with books and a
great deal of invaluable assistance on line.
A step by step would be gratefully received.

Robert
 
D

Danny J. Lesandrini

I don't think I understand you schema fully enough to be correct out-of-the box
on this, but here's an idea.

Phase I: Collecting Data
1) Add a field to tblCV named FilePath and make it a 255 character text field.
2) Add this to whatever form is used to display the data on tblCV.
(you mention a subform, but that's the part that's not clear to me.)
3) Have users type in the path to the CV into this new field.

Phase II: Common Dialog for Browsing to file
You could include some code modules that will allow users to navigate to and
select a file with the common dialog forms we all know and love. I will hold off
on posting that code. It's been posted many times already on these newsgroups,
and it's not necessary for to get this process to start working. Users can type
in the path at first.

Phase III: Opening the file
There are two ways to do this. One is to set some hyperlink properties of the
field, etc. I don't have that process down, but maybe someone else does.

The method I use is this:
1) Set the IsHyperlink property of the control, let's call it txtFilePath, to true
(this will give it the hyperlink look and mouse-pointer)
2) Put this code in the Click event of txtFilePath

On Error Resume Next
Dim strFile As String

strFile = Nz(Me!txtFilePath, "")
If Dir(strFile) <> "" Then
Application.FollowHyperlink strFile
End If

Now, a single click on the txtFilePath field will open the document. If there
is no file path, this code will harmlessly exit.

Clear as mud?
 
R

Robert Painter

Hi Danny,
Well it has been some time in doing (have been on holiday in between) but am
now in the final processes of this project.

let me explain what i have.

tables: tblEmployee - EmployeeID[autono],CustomisedID[Text]
Title,FirstName,Surname,Address,Homephone,MobilePhone, etc
tblSkills - SkillID[autono],
SkillDescription[text]EmployeeIDFK[number]
tblCategory - CategoryID[autono], Categorydescription[text]
tblEmployeeSkills - EmployeeSkillID[autono], SkillIDFK[number],
EmployeeIDFK[number]
tblEmailAddress - EmailAddressID[autono].
EmailAddress[text],EmployeeIDFK
tblCvfilepath - CVID[autono], cvfilepath (was hyperlink) now
[text], EmployeeIDFK

All ID[autono] are PrimaryKeys. Relationships set.

Basically I have 3 forms frmEmployees for entering all details of employees
frm Main for entering Skills
frmEmployeeList which is a combination
of the two.
The reason for the subforms for EmailAddress and CV are to maintain
normalisation. Not all employees have either and maybe neither.

The project is for a recruitment agency which started of as a driver hire
agency doing only ad hoc work. Since then it has grown but some of the
office staff mainly only know driver hire so when they diversified into
clerical and industrial they are sometimes at a loss. My db is there for
quick reference and to search given skills be they one or many. The next
thing was can we have E-mail addresses which I have now linked and on
pressing SEND E-MAIL button mail page opens with employee address. Then we
had "can we link to CV's ? ".
I have managed to create subforms Seperately in frmEmployees with Browse
button to enter address, and in frmEmployeelist with now button with your
code entered. The reason for change was that when first made it was a
hyperlink and although the field is underlined and when you put cursor over
it a hand with pointing finger appeared, no little popup with address shows
and when clicked nothing happened so went to your code and now something
happens, (I am in Vista) and when I press the button OpenCV I get the
Eggtimer and something sems to flash on the screen but then fades/disappears
in the blink of an eye.

Sorry to have rambled on but this in now my only snag and wondered if you
could maybe shed any light on it. I am running Access 2003 and have had code
passed my way from very many very helpful people, sometimes tho it is in 97
and have worked thru tinternet to find suitable alternatives, so far so
good.

Thanks in advance if only for reading thru this

Robert
 
R

Robert Painter

Hi all,
Well it seems I may be mistaken. My link now opens if it is .doc, .txt. or
..jpg. was trying .pdf. not sure how many other formats it will open or not
but now seems to be working (will try as hyperlink again later) but just
didnt want you to waste yr time looking into it unnecessarily.


Robert Painter said:
Hi Danny,
Well it has been some time in doing (have been on holiday in between) but
am now in the final processes of this project.

let me explain what i have.

tables: tblEmployee - EmployeeID[autono],CustomisedID[Text]
Title,FirstName,Surname,Address,Homephone,MobilePhone, etc
tblSkills - SkillID[autono],
SkillDescription[text]EmployeeIDFK[number]
tblCategory - CategoryID[autono], Categorydescription[text]
tblEmployeeSkills - EmployeeSkillID[autono], SkillIDFK[number],
EmployeeIDFK[number]
tblEmailAddress - EmailAddressID[autono].
EmailAddress[text],EmployeeIDFK
tblCvfilepath - CVID[autono], cvfilepath (was hyperlink) now
[text], EmployeeIDFK

All ID[autono] are PrimaryKeys. Relationships set.

Basically I have 3 forms frmEmployees for entering all details of
employees
frm Main for entering Skills
frmEmployeeList which is a combination
of the two.
The reason for the subforms for EmailAddress and CV are to maintain
normalisation. Not all employees have either and maybe neither.

The project is for a recruitment agency which started of as a driver hire
agency doing only ad hoc work. Since then it has grown but some of the
office staff mainly only know driver hire so when they diversified into
clerical and industrial they are sometimes at a loss. My db is there for
quick reference and to search given skills be they one or many. The next
thing was can we have E-mail addresses which I have now linked and on
pressing SEND E-MAIL button mail page opens with employee address. Then we
had "can we link to CV's ? ".
I have managed to create subforms Seperately in frmEmployees with Browse
button to enter address, and in frmEmployeelist with now button with your
code entered. The reason for change was that when first made it was a
hyperlink and although the field is underlined and when you put cursor
over it a hand with pointing finger appeared, no little popup with address
shows and when clicked nothing happened so went to your code and now
something happens, (I am in Vista) and when I press the button OpenCV I
get the Eggtimer and something sems to flash on the screen but then
fades/disappears in the blink of an eye.

Sorry to have rambled on but this in now my only snag and wondered if you
could maybe shed any light on it. I am running Access 2003 and have had
code passed my way from very many very helpful people, sometimes tho it is
in 97 and have worked thru tinternet to find suitable alternatives, so far
so good.

Thanks in advance if only for reading thru this

Robert

Danny J. Lesandrini said:
I don't think I understand you schema fully enough to be correct
out-of-the box
on this, but here's an idea.

Phase I: Collecting Data
1) Add a field to tblCV named FilePath and make it a 255 character text
field.
2) Add this to whatever form is used to display the data on tblCV.
(you mention a subform, but that's the part that's not clear to me.)
3) Have users type in the path to the CV into this new field.

Phase II: Common Dialog for Browsing to file
You could include some code modules that will allow users to navigate to
and
select a file with the common dialog forms we all know and love. I will
hold off
on posting that code. It's been posted many times already on these
newsgroups,
and it's not necessary for to get this process to start working. Users
can type
in the path at first.

Phase III: Opening the file
There are two ways to do this. One is to set some hyperlink properties
of the
field, etc. I don't have that process down, but maybe someone else does.

The method I use is this:
1) Set the IsHyperlink property of the control, let's call it
txtFilePath, to true
(this will give it the hyperlink look and mouse-pointer)
2) Put this code in the Click event of txtFilePath

On Error Resume Next
Dim strFile As String

strFile = Nz(Me!txtFilePath, "")
If Dir(strFile) <> "" Then
Application.FollowHyperlink strFile
End If

Now, a single click on the txtFilePath field will open the document. If
there
is no file path, this code will harmlessly exit.

Clear as mud?
 

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