Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2003
    Location
    Sheffield, UK
    Posts
    17

    Unhappy Unanswered: Making control in report invisible

    Hi,

    I have a report which when printed calculates at total. But I want the client to be able to pick whether the two textboxes which are muliplied to make the total are shown. They pick this with a tickbox before opening the report.

    The code I have is below

    If Me.showrates = False Then
    Me.UnitLabour.Visible = False
    Me.UnitPrice.Visible = False
    End If

    where the showrates is the checkbox and the two other controls are what I want to be able to hide.

    The problem I have is that the code is wrong and I don't know where.

    Any help would be appreciated

    Farewell

    Wheelz

  2. #2
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    My assumptions: The checkbox is part of the data source; the report is a single-record invoice-style document.

    If the above are true, the code you have below should be in the Detail_Format event, and should work.

    If that doesn't work, you may want to ensure that the record update is actually being performed prior to the report opening.
    All code ADO/ADOX unless otherwise specified.
    Mike.

  3. #3
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303
    Is the problem the fact that you are using "me" in referencing both the form and the report?

    If the code is found in the OnOpen event for the report, then refer to the specific control on your form (the 'tickbox' you mentioned).

    If Forms.MyForm.showrates = False Then
    ....Me.UnitLabour.Visible = False
    ....Me.UnitPrice.Visible = False
    End If
    John
    This is the day the Lord has made, I will rejoice and be glad in it.

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Re: Making control in report invisible

    Originally posted by Wheelz
    Hi,

    I have a report which when printed calculates at total. But I want the client to be able to pick whether the two textboxes which are muliplied to make the total are shown. They pick this with a tickbox before opening the report.

    The code I have is below

    If Me.showrates = False Then
    Me.UnitLabour.Visible = False
    Me.UnitPrice.Visible = False
    End If

    where the showrates is the checkbox and the two other controls are what I want to be able to hide.

    The problem I have is that the code is wrong and I don't know where.
    Any help would be appreciated

    Farewell

    Wheelz
    Try this

    If Forms!yourForm.showRates = False Then
        Me.UnitLabour.Visible = False
        Me.UnitPrice.Visible = False
    End If

  5. #5
    Join Date
    Dec 2003
    Location
    Sheffield, UK
    Posts
    17
    Thanks for the help people. This works great

Posting Permissions

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