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

    Report Question (2000)

    I have a report that is run from a parameter query. I have different footers that I would like to have visible if someone just hits enter instead of entering anything in the parameter (I use Like [Enter Month]&"* in the parameter) and not visible if something is entered. If they hit enter for the Month parameter, I get all the months. I was using the on format event of the Month Footer and putting code something like the following:


    If IsNull(Me.I don't know what to put for the Month parameter) Then
    Me.Groupfooter.Visible = True
    Else
    Me.Groupfooter.Visible = False
    End If
    End Sub

    Is this possible?

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

    Re: Report Question (2000)

    Try

    If IsNull([Enter Month]) Then

    or if that doesn't work

    If [Enter Month] = "" Then

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

    Re: Report Question (2000)

    Using the code below:

    Private Sub GroupFooter2_Format(Cancel As Integer, FormatCount As Integer)

    If IsNull([Enter Month]) Then
    Me.GroupFooter2.Visible = True
    Else
    Me.GroupFooter2.Visible = False
    End If
    End Sub

    I get Run Time Error 2465 - Microsoft Access can't find the field '|' referred to in your expression.

    I get this error when I use "If [Enter Month] = "" Then" also.

  4. #4
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Report Question (2000)

    Linda,

    Here is a work around.

    The problem is that your parameter, in this case a null value, is acted upon prior to the report opening and causes an error if it is null since an object cant have "null" data. I hope I said that right. This work around will work to pass a parameter you can use.

    1. In your query driving the report you need to pass a "dummy" field that you can recognize in the report based on your input. Add a field called Extra to your query with the following:

    EXTRA: nz([Enter Month],"none")

    The extra field will pass to your report and become available for use in the report. If someone hits enter during the query, Extra will populate with NONE for all records since it is null. You will still get all of the records.

    2. Somewhere in the report, perhaps the header, drag and drop the Extra Field and then make it invisible.

    3. In your footer, use your previous code but as follows:

    x = me.extra

    If me.extra = "none" then
    Me.GroupFooter2.visible=true
    else...
    end if.

    HTH
    Regards,

    Gary
    (It's been a while!)

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

    Re: Report Question (2000)

    Thank you - that worked 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
  •