|
-
Mar 15th, 2000, 01:24 AM
#1
Thread Starter
Addicted Member
I need to be able to disable the "x" the close button in the upper right-hand corner of my dialog box screen; anyone know the code for this or how to do it?
what happenes is that i have a cancel button to go back to main program and it closes w/o updating the record; however if the user happens to use the "x" instead of cancel the record will update and that leaves a blank or inaccurate record in the database.
any help would be greatly appreciated, thanks!!!
-
Mar 15th, 2000, 01:39 AM
#2
Lively Member
in the Form_QueryUnload event you can test to see how the form is being closed:
if unloadmode = vbformcontrolmenu
the form is being closed by the x button and you can cancel the form closing by
cancel = true
or
if unloadmode = vbformcode
the form is being closed by code in the button and proceed
and allow the form to close
another idea...
set the form borderstyle to none
hope this works for you 
Edited by _bman_ on 03-15-2000 at 01:49 PM
-
Mar 15th, 2000, 02:46 AM
#3
Junior Member
The following link shows you how to disable the close button via API
http://www.vb-world.net/tips/tip117.html
-
Mar 15th, 2000, 02:48 AM
#4
Thread Starter
Addicted Member
Disable "X" in the Dialog Box
i tried boarderless and it did not take away or enable the minimize, maximize and close buttons on the upper-right hand corner of my dialog box. Also, the record is still saving when i use the unloadmode=vbformcontrolmenu even though it is cancelling the form; any ideas how do i disable the "x"; any more ideas; please!!! i even put code in after cancel=true to not update the database to no avail.
thanks for all help and i already learned something new; cool!!!
-
Mar 15th, 2000, 02:57 AM
#5
Thread Starter
Addicted Member
Disable "X" in the Dialog Box
okay spoke to soon i put
if unloadmode=vbformcontrolmenu
then
data2.recordset.edit
data2.recordset.cancelupdate
cancel=true
end
endif
and it cranks it cancels quits the program and does not update the record and using just the cancel command will bring me back to the form -- thanks big time -- your a genius!!!!!
It's the little things in life that make the big things easier!!!!
-
Mar 15th, 2000, 03:01 AM
#6
Hyperactive Member
If you don't need to give your users the minimize/maximize options, you can also set the form's ControlBox to False
-
Mar 15th, 2000, 03:45 AM
#7
Member
for them sort of problems go to
http://www.geocities.com/CollegePark/Library/3001/vblink.html
-
Mar 15th, 2000, 04:40 AM
#8
Thread Starter
Addicted Member
I also found if you set the controlbox property of the form to false you get no minimize, maximize and close button at all a very quick solution!!
thanks for everything!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|