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?