FW: [AccessD] A2K - setting a form invisible on open

Roz Clarke roz.clarke at donnslaw.co.uk
Mon Nov 10 03:39:35 CST 2003


Forwarded on behalf of Robert; Bryan can you check why this message was
blocked?

thanks

Roz

-----Original Message-----
From: Robert Gracie [mailto:Robert at servicexp.com] 
Sent: 09 November 2003 04:37
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] A2K - setting a form invisible on open


John

This is real crude but will this work...

Form Level

Private Sub Form_Open(Cancel As Integer)
Dim ScrVis As Long
ScrVis = 0 'LWS Check Point
           'ScrCount is a global counter, to make sure we don't loop If
ScrVis = 0 And ScrCount = 0 Then ScrCount = 1 Call Openform(Me.Name) End If
End Sub

Module Level

Public Sub Openform(FrmName As String)
DoCmd.Close acForm, FrmName
DoCmd.Openform FrmName, , , , , acHidden
End Sub


Robert Gracie
www.servicexp.com



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


Dan,

I appreciate this.  Unfortunately this doesn't really solve my problem.

I am designing a LightWeight Security system.  The system is designed to
control access to forms and controls such that a designer enters data in
tables that define who can see / open forms etc.  This means that I don't
control the properties of a form at run time.  It isn't my database.

My wizard has to be able to take ANY form and open it invisible.  Further,
if a form attempts to unhide, my wizard code has to determine if the current
user is allowed to unhide it, and if not then prevent the unhide.

John W. Colby
www.colbyconsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Dan Waters
Sent: Saturday, November 08, 2003 3:12 PM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] A2K - setting a form invisible on open


John,

I have a startup form with quite a bit of startup code behind it.  To make
it invisible, I go to the database window, right-click the form, then select
properties.  Then check the Hidden checkbox.  Now the form will never
display, but all the code behind the form runs from the form's Open event.
The form also closes itself after it does all it's things and opens the
switchboard form.

For you to be able to see and select the form from the list in the database
window, go to Tools|Options, then select the View tab and check the Show
Hidden Objects checkbox.  Now, when the form list is displayed in the
database window, the startup form's small icon will be 'grayed out' to
indicate that this form is hidden.

As long as your users can't muck around in Tool|Options and can't open the
database window, this may work for you.

HTH!
Dan Waters
Quality Process Solutions



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Colby
Sent: Saturday, November 08, 2003 10:11 AM
To: AccessD
Subject: [AccessD] A2K - setting a form invisible on open


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.

Has anyone ever seen such a strangeness?

John W. Colby
www.colbyconsulting.com


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


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



_______________________________________________
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