I thought this would be easy, but it seems that if it is a hyperlink it will display that way in datasheet view. To work around it I added another text box to the form.
my hyperlink field is "hyperField" and it is displayed in "txtBxHyperField".
my added text box is "txtBxDisplayHyperText"
I added a function to a standard module
Code:
Public Function DisplayHyperFieldText(strHyper As Variant) As String
If Not IsNull(strHyper) Then
DisplayHyperFieldText = Split(strHyper, "#")(0)
End If
End Function
That becomes the control source of my new text box "txtBxDisplayHyperText"
=DisplayHyperFieldText
So in the form module I first hide the real hyperlink field
Code:
Private Sub Form_Load()
Me.txtBxHyperfield.ColumnHidden = True
End Sub
and put in a click event for the fake hyperlink field
Code:
Private Sub TxtBxDisplayHyperText_Click()
FollowHyperlink (Me.txtBxHyperfield.Hyperlink.Address)
End Sub
There is a property "Display as Hyperlink", but this only allows you to display a text field as a hyperlink: "always, only if hyperlink, on screen". There is no choice to not display as hyperlink. I could not find a way to make a hyperlink not display as a hyperlink in datasheet view. There may be an easier way, but this work-around was the only thing I could come up with.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.