Auto populate Hyperlink control.

Wildjonno

New member
Local time
Today, 15:45
Joined
Nov 15, 2014
Messages
1
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.
 
Welcome to the Forum Jon,

Have you considered the properties of the label you are using with the Textbox and use the Hyperlink property to launch the link based on the textbox content. Something like this might work

PHP:
Private Sub Form_Current()
Me.lblLink.HyperlinkAddress = Me.txtEmail
End Sub
 

Users who are viewing this thread

Back
Top Bottom