Report detail not functioning

  • Thread starter Thread starter Brandon Schultz
  • Start date Start date
B

Brandon Schultz

I have no idea why this isn't working but it will not make the label and
text box invisible:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Me.txtCusComplaintNum = Null Then
Me.txtCusComplaintNum.Visible = False
Me.lblCustomerComplaintNumber.Visible = False

Else: Me.lblCustomerComplaintNumber.Visible = True
Me.txtCusComplaintNum.Visible = True
End If

End Sub

If you do a ?Me.txtCusComplaintNum in the debug window it indeed shows the
value null. I have written similiar snibits of code and they function
properly. Am I missing something simple? I get no errors.

Thanks,

Brandon Schultz
 
Nothing is ever equal to Null, Brandon, because Null is an unknown value. If
something is unknown, then the result of any comparison with that unknown
value is also unknown.

Use the IsNull() function instead of the = operator to test for Null values.
 
Back
Top