A family of Microsoft relational database management systems designed for ease of use.
I found the issue. Another problem elsewhere was causing the code to fail. When I fixed what I thought was a non-related error the problem went away...
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am using Access 2016. I have a function that checks if a form is open. The same code has been used for years with no issues:
If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then
If Forms(strFormName).CurrentView <> conDesignView Then
IsLoaded = True
End If
End If
All of a sudden it is failing with the message "Method 'item' of object 'Forms' failed." on the line If Forms(strFormName).CurrentView <> conDesignView Then. I have stepped through the code in debug mode and it works fine. As soon as I try to run I get an error...
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
I found the issue. Another problem elsewhere was causing the code to fail. When I fixed what I thought was a non-related error the problem went away...