[AccessD] Removing Exit ability

Darren DICK d.dick at uws.edu.au
Thu Apr 8 09:01:42 CDT 2004


Hi Mike
In the property sheet of you form
Have a look on the FORMAT tab (The first one)
About half way down Under Max and Min options is the option to Set the Close button
Yes = There is on
No = There aint one (well there is but it's disabled)

oops Just re-read your post You wanna apply this to Access not a form

When the dB starts have a form open with its visible property set to false
docmd.OpenForm "frmYourFormNameHere",acNormal ,,,,acHidden
Then on the Unload event of that hidden form have something like this

Private Sub Form_Unload(Cancel As Integer)

On Error GoTo Err_Form_Unload

    If MsgBox("Are you sure you want to CLOSE 'the name of your application here' completely?", vbQuestion + vbYesNo, "Close 'Name
of Your Application Name here?") = vbYes Then
        DoCmd.Quit acQuitSaveAll
    Else
        Cancel = true
    End If

Exit_Form_Unload:
Exit Sub

Err_Form_Unload:
MsgBox Err.Number & "  " & Err.Description, vbCritical, "Error in Form_Unload module"
Resume Exit_Form_Unload

End sub

Hope this helps

Darren

----- Original Message ----- 
From: "Gowey Mike W" <Mike.W.Gowey at doc.state.or.us>
To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com>
Sent: Thursday, April 08, 2004 11:46 PM
Subject: [AccessD] Removing Exit ability


>
> Hi Everyone,
>
> Could anyone please tell me how I can remove the ability for the user to
> click on the X to close Access, I want them to only be able to use the
> buttons I have created on the forms to exit the program.
>
> Thanks for any help.
>
>
> Mike Gowey, MCSA, A+, ACE
> Team Leader - SRCI
> Information Systems & Services Division
>
>
>
> -- 
> _______________________________________________
> 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