jwcolby
jwcolby at colbyconsulting.com
Thu Aug 26 21:59:52 CDT 2010
The internet is an amazing place!
Thanks Susan!!!
'
'http://articles.techrepublic.com.com/5100-10878_11-5069824.html
'By Susan Harkins
'
'Returns:
'-1 if the form is closed
'0 if the form is in design view
'1 if the form is open
'
Function FormViewStatus(formname As String) As Integer
Dim varFrmState As Variant
If SysCmd(acSysCmdGetObjectState, acForm, formname) <> 0 Then
varFrmState = Forms(formname).CurrentView
End If
If IsEmpty(varFrmState) Then
varFrmState = -1
End If
FormViewStatus = varFrmState
End Function
John W. Colby
www.ColbyConsulting.com
jwcolby wrote:
> In my PLSS, when a form is open and a different user logs in, I need to reapply security to all open
> forms. The new logged in user will probably have different rights than the previous logged in user.
> Any forms the new user opens after they log in will have security applied as they open, but any
> forms already open need to have their security reapplied to reflect the group memberships of the new
> user.
>
> So says I, just go to the Application.Forms() collection, right?
>
> Yea, except that forms open in design view are also in there. Hmm... If I just apply new boolean
> values to the visible, AllowEdits etc properties of a form in design view... those changed
> properties will be saved when the form (in design view) is closed.
>
> Not good.
>
> So how do I determine that a form is open in design view?
>