Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Nov 2005
    Location
    Mamaroneck, New York, USA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Run-Time error 2455 report.hasdata (A2K/9.0.4402 S

    Me!srRemarks.Visible = Me!srRemarks.Report.HasData

    I know this code was working before, but now I get the 2455 error, "Invalid reference to the property Form/Report". Any suggestions?

    Bill

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

    Re: Run-Time error 2455 report.hasdata (A2K/9.0.4402 S

    Welcome to Woody's Lounge!

    1) Make sure that srRemarks is the name of the subreport as a control on the main report. This is not necessarily the same as the name of the subreport in the database window.
    2) Where (in which procedure) do you have this code?

  3. #3
    New Lounger
    Join Date
    Nov 2005
    Location
    Mamaroneck, New York, USA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run-Time error 2455 report.hasdata (A2K/9.0.44

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me!srRemarks.Visible = Me!srRemarks.Report.HasData
    Me!srDates.Visible = Me!srDates.Report.HasData
    Me!srEngineers.Visible = Me!srEngineers.Report.HasData
    End Sub

    The code, as you can see, runs in the On Format event of the Detail section of the main report. srRemarks is the name (Other tab in properties dialog for the control) of the control, not the sub report itself (source object of the control in the Data tab). The report used to open just fine, but I haven't looked at it for a couple of months. I have no idea what could be causing it to fail now.

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

    Re: Run-Time error 2455 report.hasdata (A2K/9.0.44

    Strange problem, the code looks OK. Could you post a stripped down copy of your database? That would enable Loungers to look at the problem directly. See <post#=401925>post 401925</post#> for instructions.

  5. #5
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run-Time error 2455 report.hasdata (A2K/9.0.44

    Does the source object (the report itself, not the control) still exist? (ie. it hasn't been deleted/renamed etc.)

    <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17>Sorry if that seems like a patronising question, it's not meant to be! It's just worth checking the basics
    Waggers
    If at first you do succeed, you&#39;ve probably missed something.

  6. #6
    New Lounger
    Join Date
    Nov 2005
    Location
    Mamaroneck, New York, USA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run-Time error 2455 report.hasdata (A2K/9.0.44

    Yes, it exists. I get to the code by opening up the event in the properties dialog for the report.
    I have seen sporadic mention of this baffling phenomenon in a couple of chat groups, but no resolution. It's puzzling because it used to work. Nothing has changed that I can recall, but it has just ceased working.

    Bill

  7. #7
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Run-Time error 2455 report.hasdata (A2K/9.0.44

    A couple of other possibilities - the MDB file has corrupted, in which case try pulling all of the objects into a new empty database, but first try doing a decompile of the VBA project. If you search this forum for "decompile" you will find several threads on the subject.
    Wendell

Posting Permissions

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