X close button

G

Guest

hi,

a simple question im sure. within the properties box on all of my forms i
have changed the close button bit to No, to stop people using the X in the
corner of the screen to close down forms...

on some of the forms the X is still there and people are still using it: how
do i get rid of the X on all of the forms and on the application ?
 
G

Guest

wayne thanks for this links below, ive had a look and can reproduce the
unload event for my switchboard, but dont know how to create a new module.

i know where to find the button that says new module and it opens up a code
window when i press it. ive entered the 2 lines of code indicated in the
link but dont know what goes before or after it as its not stated in the link

grateful for any help you can give.

on the other issue ive tried to enter the code to get around the maximize
problem but am not sure how to top and tail that code either or indeed where
im supposed to put it?

paul
 
W

Wayne Morgan

If you're using the switchboard form, place the line

pboolCloseAccess=False

in the Open event of the Switchboard and place Public pboolCloseAccess As
Boolean in the top part of a new module (where it says Option Compare
Database and, hopefully, Option Explicit). It can also be placed in the same
location in your switchboard's module, but public variables are usually
placed in standard code modules.

For the second item, create a new module. Copy and paste everything from the
blue part of the page into the code module right below "Option Compare
Database" and "Option Explicit". The names of the procedures are already in
what you're pasting, so they will be created properly automatically. Save
the module and give it a UNIQUE name, such as basMyMaximizeProcedures.

To use this, you would then call the procedure in this module instead of
DoCmd.Maximize in the form's code.

Example:
MaximizeRestoredForm Me

I found I had to make a slight modification to the following line. I believe
it is to allow for the height of the title bar of the form.

MoveWindow F.hWnd, 0, 0, MDIRect.x2 - MDIRect.x1, MDIRect.y2 - MDIRect.y1 -
26, True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top