I have a form titled 'New/Edit/Search Contractor Employee" that provides controls to fields within a table titled "Contractors". In this table, I have a Hyperlink field that will store the location of the files related to individual employees. On this form, I have a Control that (at the moment) the user can copy a Hyperlink and enter into this, to populate the field. This will then allow the user to click on this Hyperlink to open up the individual folder location to drag and drop whatever files they want associated to this individual record.
I have created a Command Button to automatically create a unique folder for this record, VBA below:
Private Sub Command168_Click()
strPath = "V:\IntProd\Trans&Ops\TERMINALS\Driver and Contractor Database 2014\ContIndPW" & "\" & txtCompanyID
If Len(Dir(strPath, vbDirectory)) = 0 Then
MkDir strPath
End If
strPath = "V:\IntProd\Trans&Ops\TERMINALS\Driver and Contractor Database 2014\ContIndPW" & "\" & txtCompanyID & "\" & txtFirstName & " " & txtLastName
If Len(Dir(strPath, vbDirectory)) = 0 Then
MkDir strPath
End If
End Sub
What I'm trying to work out now is how to automatically enter this new folder location into the Control, which is then viewable and can be clicked on. I managed to do this (can't for the life of me remember how) but it entered the location as text and I wasn't able to click.
Can any of you add further code to correctly do this? I'm literally struggling right now as this is the first time I've worked with Access.
The Hyperlink control is titled 'Induction Paperwork' relates to a Hyperlink field.
Thanks,
Jon.
I have created a Command Button to automatically create a unique folder for this record, VBA below:
Private Sub Command168_Click()
strPath = "V:\IntProd\Trans&Ops\TERMINALS\Driver and Contractor Database 2014\ContIndPW" & "\" & txtCompanyID
If Len(Dir(strPath, vbDirectory)) = 0 Then
MkDir strPath
End If
strPath = "V:\IntProd\Trans&Ops\TERMINALS\Driver and Contractor Database 2014\ContIndPW" & "\" & txtCompanyID & "\" & txtFirstName & " " & txtLastName
If Len(Dir(strPath, vbDirectory)) = 0 Then
MkDir strPath
End If
End Sub
What I'm trying to work out now is how to automatically enter this new folder location into the Control, which is then viewable and can be clicked on. I managed to do this (can't for the life of me remember how) but it entered the location as text and I wasn't able to click.
Can any of you add further code to correctly do this? I'm literally struggling right now as this is the first time I've worked with Access.
The Hyperlink control is titled 'Induction Paperwork' relates to a Hyperlink field.
Thanks,
Jon.