hyperlink problem

  • Thread starter Thread starter Amy Little
  • Start date Start date
A

Amy Little

Guest
I want to create a hyperlink based on the information on a form. The fields are FName, LName, CaseNo, and Program where program is a drop down box that it not related to the record. When the user chooses a program the hyperlink should fill in as follows. C:\Documents and Settings\username\My Documents\FileFolder\Program\FNameLNameCaseNo. This will open that customers folder under the specific program. I have created a text box that will generate the string but when I set the Hyperlink property to yes the field looks like a hyperlink but you cannot click on it. Does any one have any ideas? Amy I going about this the wrong way?
 
Maybe try using the fully qualified path including the machine name - i.e. \\MyMachineName\C:\...........

HTH
Patrick
 
If you are generating the hyperlink with a textbox you could create a string variable that stores the path and then you could put the hyperlink on a command buton.

As an example:

I have a form with a listbox and a command button.
The listbox is called lstOptions and the command button is called cmdOpenPath.

In the listbox I have two values: Common and Personal.

What I want to do is open a hyperlink up to either my Common folder or my Personal folder when I click on the command button.

So, on the listbox's AfterUpdate() event i put this code:

Code:
Select Case lstOptions
   Case Is = "Personal"
      cmdOpenPath.Hyperlink.Address = "F:\"
   Case Is = "Common"
      cmdOpenPath.Hyperlink.Address = "K:\Common\"
End Select

If I now click on the command button it leads me to the specified path.

Apologies if this rambling has been irrelevant.
 
I have a form where a hyperlink is used and I do not know if you want to go this way but this code will open up the hyperlink editor and will allow them to just point to the file location and it will store the hyperlink for them. I just put it in the "got focus" event of the textbox field.

On Error GoTo ErrorHandler
DoCmd.RunCommand acCmdInsertHyperlink
ExitHere:
ErrorHandlerExit:
Exit Sub

ErrorHandler:
If Err.Number = 2501 Then
stdresponse = acDataErrContinue
Exit Sub
MsgBox Err.Description
Resume ErrorHandlerExit

Exit Sub
End If

Hope it help.

Spil
 

Users who are viewing this thread

Back
Top Bottom