[AccessD] A2K - setting a form invisible on open

John Colby jcolby at colbyconsulting.com
Sat Nov 8 12:25:08 CST 2003


Gustav,

Good thought.  I'll try that.  It seems that if I use exactly your code then
the form would try to open, would already be open so would "fail" and would
then return and continue closing.  I'll see though.

I also have to handle making user the form can never be made visible
manually though.  See my email re what happens if you unhide it twice in a
row.

John W. Colby
www.colbyconsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Gustav Brock
Sent: Saturday, November 08, 2003 1:15 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] A2K - setting a form invisible on open


Hi John

Couldn't you cancel the opening when this should not be allowed and
then call a subfunction to open the form not visible:

<code>

  Public Sub Form_Open(Cancel As Integer)

    Cancel = IsVisibleDisabledForCurrentUser()

    If Cancel = True Then
      Call SubFunctionToOpenFormNotVisible(Me.Name)
    End If

  End Sub

</code>

/gustav


>> I have a form I want to open invisible every time it opens, regardless of
>> how it is opened.  I placed me.visible = false in OnOpen.  That doesn't
>> work!  The strange part is that if I place a breakpoint on the line and
>> stop execution on the me.visible = false, then continue, the form
>> correctly hides itself.

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list