• 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.

Thanks
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

0
Sandman2
Asked:
Sandman2
  • 3
2 Solutions
 
GRayLCommented:
Forms("frmName").currentview

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

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