• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 447
  • Last Modified:

Check if MS Accees form is in Design view

I was wondering if anyone knew how to check if a form is open in design view. I have a function that I call to check if the form is open and it works OK. The problem is that the form is open in design mode, the code still returns True. If the form is in design mode, I want the function to return False.

Private Function IsOpen(strName As String,  Optional lngObjectType As AcObjectType = acForm)
    ' Returns True if strName is open, False otherwise.
    ' Assume the caller wants to know about a form.
    IsOpen = (SysCmd(acSysCmdGetObjectState, lngObjectType, strName) <> 0)
End Function

Open in new window

  • 3
2 Solutions

yields 0 if opened in design view
Press Alt+F11 to get to the VBA Editor window and enter - currentview - in the Help window.  Its all there.
Sandman2Author Commented:
Thanks for the help. That works perfectly. Split the points b/c the second comment went beyond my initial comment.
Thanks, glad to help.  Remember, Help is a terrific source of info - especially over on the VBA side of things.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now