B
BruceM
I'm not quite sure what to ask. I have a public function that, depending on
values such as expiration date, generates one of several text strings that
are used on faxes. Here is a shortened version:
Public Function FaxText(NoExp As Boolean, CertType As String) As String
' Function is used as the control source for a text box on the fax
(report)
' that reminds vendors a cert has expired
Dim intStatus As Integer
' CertReturned = True until a cert has been requested. CertReturned =
True _
' for certs that are in good order (i.e. still current or pending)
If NoExp = False Then
If CertType <> "Survey" Then
intStatus = 1
Else
intStatus = 2
End If
Else
intStatus = 3
End If
Select Case intStatus
Case 1
FaxText = "Option 1"
Case 2
FaxText = Option 2"
Case 3
FaxText = "Option 3"
End Select
The Control Source of a text box on a report is:
=FaxText([NoExp],[CertType])
The thing is that I would like to add in some places the equivalent of
Cancel = True. The actual function has several more condtions than does
this example, so maybe the need for Cancel does not arise here, but it does
in the real function. The trouble is that I get a Variable not Defined
error when I compile if I try to use Cancel = True. I suppose I need to add
Cancel as Integer at the beginning of the function, but I can't figure out
where to put it. Or maybe I'm not even close.
values such as expiration date, generates one of several text strings that
are used on faxes. Here is a shortened version:
Public Function FaxText(NoExp As Boolean, CertType As String) As String
' Function is used as the control source for a text box on the fax
(report)
' that reminds vendors a cert has expired
Dim intStatus As Integer
' CertReturned = True until a cert has been requested. CertReturned =
True _
' for certs that are in good order (i.e. still current or pending)
If NoExp = False Then
If CertType <> "Survey" Then
intStatus = 1
Else
intStatus = 2
End If
Else
intStatus = 3
End If
Select Case intStatus
Case 1
FaxText = "Option 1"
Case 2
FaxText = Option 2"
Case 3
FaxText = "Option 3"
End Select
The Control Source of a text box on a report is:
=FaxText([NoExp],[CertType])
The thing is that I would like to add in some places the equivalent of
Cancel = True. The actual function has several more condtions than does
this example, so maybe the need for Cancel does not arise here, but it does
in the real function. The trouble is that I get a Variable not Defined
error when I compile if I try to use Cancel = True. I suppose I need to add
Cancel as Integer at the beginning of the function, but I can't figure out
where to put it. Or maybe I'm not even close.