Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    87

    Unanswered: invisible field in report

    Hello, i have a form, and there is "discount" textbox in it. Then I have a report that shows discount textbox (and label) from this form.
    Now I need to do such thing: if discount value in the form = 0 , then after i open report, this whole textbox and label won't be visible.If not 0, then both, label and textbox are visible in report.

    How exactly should i do it?

    Thank you
    Last edited by YZF; 11-04-05 at 03:56.

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    Assuming your report textbox is bound to current data....

    You will need to place a little code into your report. In the OnFormat event for the report section that contains the Discount TextBox (usually the Details section), copy and paste the following code:
    Code:
    If Nz(Me.myDiscountTextBoxName, 0) = 0 Then
       Me.myDiscountTextBoxName.Visible = False
    Else
       Me.myDiscountTextBoxName.Visible = True
    End If
    You will of course need to change the myDiscountTextBoxName to the proper control name used in your report for the TextBox. You shouldn't have to worry about the label for the TextBox since it should be a linked child to the TextBox. If it isn't then either create a new TextBox or also add the Label name into the code as well, like this:
    Code:
    If Nz(Me.myDiscountTextBoxName, 0) = 0 Then
       Me.myDiscountTextBoxName.Visible = False
       Me.myLabelName.Visible = False
    Else
       Me.myDiscountTextBoxName.Visible = True
       Me.myLabelName.Visible = True
    End If
    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  3. #3
    Join Date
    Oct 2005
    Posts
    87
    Thank you! It works perfectly

Posting Permissions

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