Code to cancel hyperlink action

jrubins

Registered User.
Local time
Today, 10:50
Joined
Jul 13, 2009
Messages
12
I have a report that displays data from a Count Query. Below that displayed data on the report is a link to a word document. I want to write code so that when you click on the link, if the data from the Count Query is "0", the link won't work. This is what I've tried:

Private Sub Label26_Click()
If Me.Need_Thank_You_Note.Value = "0" Then
Dim Response As Integer

Response = MsgBox("There are no caregiver records to deal with.", vbRetryCancel, "Error")

If Response = vbRetry Then
Me.Requery
Else
End
End If
End If
End Sub

Any help would be greatly appreciated.
 
I'd be more pre-emptive and only display the link if there is a valid destination...
Code:
Private Sub SomeReportSection_Format(...)
  MyLink.Visible = < Your Link Visibility Criteria Expression Here >
End Sub
 
Thanks lagbolt. That did it.
 

Users who are viewing this thread

Back
Top Bottom