M
Mike
I inherited a very complex database from another developer
who is no longer with my company. On a specific report,
he had it so that if a specific field does not contain any
data, it would not print the label, but if it did contain
data, it would print the label and the information it
contains. The Control Source for the field looks as
follows.
="Voice : " & [Voice]
There is some VBA attributed to the report with code that
looks like:
If IsNull(Voice.Value) Then
LblVoice.Visible = False
Else
LblVoice.Visible = True
End If
If IsNull(Fax.Value) Then
LblFax.Visible = False
Else
LblFax.Visible = True
End If
This is telling the report that if the value is null, do
not print the label "Voice", but if there is a value, to
print "Voice: 703-555-1234"
I am trying to do this for other fields (e.g. POCName) on
the report using the same process. I try to replicate the
code to my own use, to look like for example:
If IsNull(POCName.Value) Then
LblPOCName.Visible = False
Else
LblPOCName.Visible = True
End If
However, I get the error code "Compile error: Variable not
defined" and the "POCName" is highlighted. I am not very
proficient with VBA, but where do I define the variable?
Using the "Find" function, I hunted through the code of
the entire project for where the original developer may
have defined the variables for "Voice" or "Fax", but I can
not find them anywhere. I assume there is a a Dim
statement somewhere, but where?!
Any assistance would be appreciated.
m.
who is no longer with my company. On a specific report,
he had it so that if a specific field does not contain any
data, it would not print the label, but if it did contain
data, it would print the label and the information it
contains. The Control Source for the field looks as
follows.
="Voice : " & [Voice]
There is some VBA attributed to the report with code that
looks like:
If IsNull(Voice.Value) Then
LblVoice.Visible = False
Else
LblVoice.Visible = True
End If
If IsNull(Fax.Value) Then
LblFax.Visible = False
Else
LblFax.Visible = True
End If
This is telling the report that if the value is null, do
not print the label "Voice", but if there is a value, to
print "Voice: 703-555-1234"
I am trying to do this for other fields (e.g. POCName) on
the report using the same process. I try to replicate the
code to my own use, to look like for example:
If IsNull(POCName.Value) Then
LblPOCName.Visible = False
Else
LblPOCName.Visible = True
End If
However, I get the error code "Compile error: Variable not
defined" and the "POCName" is highlighted. I am not very
proficient with VBA, but where do I define the variable?
Using the "Find" function, I hunted through the code of
the entire project for where the original developer may
have defined the variables for "Voice" or "Fax", but I can
not find them anywhere. I assume there is a a Dim
statement somewhere, but where?!
Any assistance would be appreciated.
m.