none
You entered an expression that has an invalid reference to the property Form/Report (error 2455) RRS feed

  • Question

  • Access 2010 running in Office 2010 (32bit) under Windows7. I have a master form with 5 subforms in a tab control. The subforms are not bound to their recordsources. When the user clicks on a tab, I execute a procedure called "LoadSubform". Following is an example of the code for one of the subforms:

    This has worked fine for months, until now my latest build is throwing Error 2455: "You entered an expression that has an invalid reference to the property Form/Report". If I revert back to the previous build it works fine. I didn't change anything in LoadSubform in the new build. So I did a decompile, and the problem went away. But when I uploaded the accdb to my client's 2 workstations, the error resurfaced. (Same versions of Access, Office and Windows, and same library references). I tried decompiling on the client's PCs but this time it didn't rectify the problem. So it executes fine on my laptop but not on my client's workstations.

    Any ideas on what could be the cause of this error?

    Thanx!


    Darrell H Burns


    Monday, April 4, 2016 5:57 PM

Answers

  • Karl, so sorry for not responding earlier. I used to get an email notification when someone replied to my MSDN posts but that doesn't seem to be happening anymore, so I wasn't aware that you had replied.

    I actually stumbled across the source of the error...
    The error was thrown when the sqlStr returned empty. So I was trying to set the recordsource on an empty dataset.

    It certainly isn't clear by the error message that that's what the cause is.


    Darrell H Burns

    Wednesday, April 20, 2016 5:37 PM

All replies

  • Hi,

    the form property sometimes has strange effects. Recently I've had unexplicable errors concerning references to controls in a subform. IIRC Access in one line requiring "Form" and in the next line not accepting it. Same setting: A10 32 bit, Win7. Maybe your problem is similar.

    Generally I would not use the explicit Form property in a main form (where it is never required). Try:

    Forms("Property_Master")("Property_Service_Subform").Form.RecordSource


    cu
    Karl
    Access FAQ (de/it): donkarl.com
    Access Lobby: AccessDevelopers.org

    Monday, April 4, 2016 7:28 PM
  • Karl, so sorry for not responding earlier. I used to get an email notification when someone replied to my MSDN posts but that doesn't seem to be happening anymore, so I wasn't aware that you had replied.

    I actually stumbled across the source of the error...
    The error was thrown when the sqlStr returned empty. So I was trying to set the recordsource on an empty dataset.

    It certainly isn't clear by the error message that that's what the cause is.


    Darrell H Burns

    Wednesday, April 20, 2016 5:37 PM
  • Hi Darrell,

    >>The error was thrown when the sqlStr returned empty. So I was trying to set the recordsource on an empty dataset.

    It seems you have found the root cause, am I right? If so, I suggest you mark your reply as answer to close this thread. If not, please feel free to let us know.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, April 21, 2016 2:33 AM