Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

microsoft access 97 close button

Status
Not open for further replies.

zzzqqq

Programmer
Oct 12, 2005
17
IE
Hi,
Anyone know in microsoft access 97 is it possible to remove the close button (top right hand corner) when a form is maximised?
Thanks.
 
z[sup]3[/sup]q[sup]3[/sup],

Yes, it is possible. Look in Access help about a form's Close Button property.....

Si hoc legere scis, nimis eruditionis habes
 
Please post all Access questions in the Access forums. You will get a better response.

Set the Close Button property of the form to NO
Set the Control Box property of the form to NO

Set up global variable in the form's VBA declaration area: Looks like -
Option Compare Database
Public OK2Close As Boolean

On the form's On Load event place:
Private Sub Form_Load()
OK2Close = False
End Sub

On the Form's On Open event place:
Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
End Sub

On the form's On Unload event place:
Private Sub Form_Unload(Cancel As Integer)
Cancel = Not OK2Close
End Sub

On the form's command button to close the form, place:
Private Sub Command5_Click() 'This is the close button code
On Error GoTo Err_Command5_Click

OK2Close = True
DoCmd.Quit

Exit_Command5_Click:
Exit Sub

Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click

End Sub
 
Please disregard my first sentence. I just copied it from an answer I gave months ago and forgot to delete it. It obviously doesn't pertain to you.
 
Cheers Mate. You just saved my project.
Mark.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top