Hi,
I'm having trouble adding a hyperlink to a report. My underlying query has a field called LinkLive. If LinkLive has a value for a particular record in the report, I want the hyperlink to appear and work for the user ( The report will be exported as html). If linkLive has no value stored for that record then the hyperlink disappears. I have placed a textBox containing the linkLive value(invisible) on my report which I can use as a test.
I'm fairly happy that I have the correct programming logic, but I'm not happy with the events whch trigger my test. I've tried Detail.Format but this doesn't appear to fire. I've used debug.print in the Detail_Format routine as a test, but I never get any output.
I've used the Detail_Paint event, but I get inconsistent values associate with my hyperlinks. I've searched to try and find somewhere which explains Access reports events without any luck.
Here's the code I've been using, but using the Detail_paint event seems to fire it too often and I get these inconsistent hyperlinks (links where there shouldn't be and HyperlinkAddress which relates to another record).
I'm having trouble adding a hyperlink to a report. My underlying query has a field called LinkLive. If LinkLive has a value for a particular record in the report, I want the hyperlink to appear and work for the user ( The report will be exported as html). If linkLive has no value stored for that record then the hyperlink disappears. I have placed a textBox containing the linkLive value(invisible) on my report which I can use as a test.
I'm fairly happy that I have the correct programming logic, but I'm not happy with the events whch trigger my test. I've tried Detail.Format but this doesn't appear to fire. I've used debug.print in the Detail_Format routine as a test, but I never get any output.
I've used the Detail_Paint event, but I get inconsistent values associate with my hyperlinks. I've searched to try and find somewhere which explains Access reports events without any luck.
Here's the code I've been using, but using the Detail_paint event seems to fire it too often and I get these inconsistent hyperlinks (links where there shouldn't be and HyperlinkAddress which relates to another record).
Code:
If IsNull(Me.tbLiveLink.Value) Then
Debug.Print ("LiveLink is empty")
Me.Label20.Caption = ""
Me.Label20.HyperlinkAddress = ""
Else
Debug.Print ("LiveLink is NOT empty")
Me.Label20.Caption = Me.tbLiveLink.Value
Me.Label20.HyperlinkAddress = ""
Me.Label20.HyperlinkAddress = Me.tbLiveLink.Value
Me.Label20.FontUnderline = True
Me.Label20.ForeColor = RGB(0, 0, 255)
Me.Label20.FontBold = True
End If