Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jan 2005
    Location
    Wichita, Kansas, USA
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hiding labels and text boxes in response to dialog (2000-SR1)

    I have a report that we would like to show financial info in a series of text boxes and labels for administrators' eyes only, and the same report to print at times with those text boxes and labels hidden for the non-administrators. I realize I could easily copy that report and remove or make not visible those controls on the copy of the report. I was wanting, however, to have a prompt on printing to choose whether or not to print the financial info. What is the best way to accomplish this?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hiding labels and text boxes in response to dialog (2000-SR1)

    Create a form frmChoose with a check box chkFinancial and a command button cmdReport that opens the report.

    Put code in the On Format event of the detail section of the report:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.txtThis.Visible = Forms!frmChoose!chkFinancial
    Me.txtThat.Visible = Forms!frmChoose!chkFinancial
    ...
    End Sub

    Do the same for other sections if necessary.

  3. #3
    2 Star Lounger
    Join Date
    Jan 2005
    Location
    Wichita, Kansas, USA
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hiding labels and text boxes in response to di

    That did the trick! Many thanks, Hans.

  4. #4
    2 Star Lounger
    Join Date
    Jan 2005
    Location
    Wichita, Kansas, USA
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hiding labels and text boxes in response to di

    I did find a problem...
    If the checkbox

  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Hiding labels and text boxes in response to di

    From what you describe it seems like the check box is Null to start with. When you check it, it would have a state of True, and when you clear it, it would have a state of False.

    Why don't you set the default to False to begin with.

  6. #6
    2 Star Lounger
    Join Date
    Jan 2005
    Location
    Wichita, Kansas, USA
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hiding labels and text boxes in response to di

    Thanks, Pat...that seems to have remedied it.

    Warren

Posting Permissions

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