Results 1 to 6 of 6
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Report Header (2000)

    I have a parameter query that asks for Like "*" &[Client Status - Active or Canceled] & "*" so they can enter canceled or active or hit enter and get both.
    In the query I put EXTRA: NZ([Client Status Active or Canceled],"None").

    In the report header I put a text box named EXTRA with its control source equal to EXTRA. I think I am doing this right so far but maybe not.
    Also in the report header I put the field ClientStatus so that when the report asks for [Client status active or canceled] and they put active the Report header reflects Active or if they type in canceled the report header says canceled.
    My problem is when they want both canceled and active and just hit enter.
    I don't want the field (ClientStatus) to appear in the report header if this is the case. Below is the code I put behind the Report Header: I know this is wrong.
    Does anyone know how I would do this? Thanks for your help.

    Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
    X = Me.Extra
    If Me.Extra = "None" Then

    Me.[ClientStatus].Visible = False
    Else
    Me.[ClientStatus].Visible = True
    End If
    End Sub

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

    Re: Report Header (2000)

    I don't think you need code. Put a text box in the report header and set its Control Source to

    =IIf([Client Status Active or Canceled]="","",[ClientStatus])

    Note: this text box shouldn't be named ClientStatus - that would cause confusion.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Header (2000)

    I put the text box in the header and did what you said but when I hit enter to get both canceled and active - the field displays active and so does the text box. I want it to disappear when the parameter is null. Am I doing something wrong?

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

    Re: Report Header (2000)

    Does this work?

    <code>=IIf(IsNull([Client Status Active or Canceled]),"",[ClientStatus])</code>

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Header (2000)

    No, that doesn't work.
    I was trying to adapt what I learned from post 348543.

  6. #6
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Header (2000)

    I figured it out. I put a label called LField in the header and used the following code:

    Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
    If Me.[Extra] = "None" Then
    Me.[Lfield].Caption = "Both Cancelled and Active"
    Else
    If Me.[Extra] = "Active" Then
    Me.[Lfield].Caption = "Active"
    Else
    If Me.[Extra] = "Canceled" Then
    Me.[Lfield].Caption = "Canceled"
    End If
    End If
    End If
    End Sub

Posting Permissions

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