Clear Hyperlink
acCmdClearHyperlink
This routine clears a hyperlink field. It needs to set the focus to a hyperlink field.
Place the code behind a button on a form.
'***************** Code Start *******************
'This code was originally written by Terry Wickenden.
'It is not to be altered or distributed,
'except as part of an application.
'You are free to use it in any application,
'provided the copyright notice is left unchanged.
Private Sub cmdClearHyperlink_Click()
On Error GoTo ErrHandler
Me.txtHyperlink.SetFocus
DoCmd.RunCommand acCmdClearHyperlink
SubExit:
Exit Sub
ErrHandler:
Select Case Err
Case 2046
'Command not available
MsgBox "Clear hyperlink is not available at this time.", vbCritical, "Not Available"
Resume SubExit
Case Else
MsgBox Err.Number & ":-" & vbCrLf & Err.Description
Resume SubExit
End Select
End Sub
'****************** Code End ********************