Results 1 to 2 of 2
  1. #1
    Join Date
    May 2012

    Unanswered: Fields on a Report

    Maybe a bit stupid to ask sins there are a lot of Trheads but im kinda stuck here....

    I want to know how to set a field on a report to Visible = false

    If got the codes:

    If Me.[txt1] = "" Then
    Me.txt2.Visible = False

    And i have:

    If Nz(Me.txt1,"") = "" Then
    Me.txt2.Visible = False

    But i get on both an error, also when i type Me.txt1.V the autofill will not show Visible.... so is it even possible to hide/show fields on a report?????

  2. #2
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    'Empty' Controls in Access seldom hold Zero-Length Strings (ZLS) which is all that your first code checks for! They are usually Null. Your second example, which checks for Nulls and ZLSs, is the correct code to use for this.

    I'm guessing that the Control names are Access-generated, in which case they would be Text1 and Text2, not txt1 and txt2, as you have in your code. This would account for everything you've reported. They key to the names being wrong is the fact that Intellisense (your 'autofill') didn't offer Visible when you typed in txt2.

    And, yes, you can hide/show Controls on a Report.

    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