Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2010

    Unanswered: onFormat, to set visible property to false on null value is not working

    Pls help; I suppose following would be the right code to hide an empty control (TestMethod) but its not working; I checked by making a query- When I put a criteria IsNull the field is removed from the query results which means that the empty fields are actually "Null"; I tried using some existing values of the field test method- it works e.g when I substituted Null with "Slide Method" all entries containing "slide method" are removed/Hidden.

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Me.TestMethod = Null Then
    Me.TestMethod.Visible = False
    End If

    End Sub

  2. #2
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    Correct syntax in VBA would be

    If IsNull(Me.TestMethod) Then

    or, to test for Null and Zero-Length String

    If Nz(Me.TestMethod, "") = "" Then

    Linq ;0)>
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts