|
-
Mar 30th, 2005, 04:03 AM
#1
Thread Starter
New Member
MS Access VBA Code ???
Hello,
I need a bit of VBA that can tell the database to ignore the prev command ??
i.e. I have form with no close button, but in the toolbar (Which is needed) there is a close button, that can also close the form your in. I have an on close event in each form which can make sure the form has been closed via the correct close command button. but If the form has not been closed correctly they I want it to ignore the previous statement/Command ???
Please Help
Steve 
-
Mar 30th, 2005, 07:36 AM
#2
Addicted Member
Re: MS Access VBA Code ???
if i understand you correctly, you are trying to prevent the user from closing the form by selecting:
File>Close
from the menu bar?
thus ensuring that they close the form via your command button?
you are by definition closing the form, and your call to check that it is closed correctly is called only when the form is closing.
you would need to re-open the form within the function (if possible), or call a global function to deal with your on close, which will re-open the form.
or to disable the in-built menus and define your own for the functionality that the user needs.
im sure someone will be along to prove me wrong in a minute
HTH
if you fail to plan, you plan to fail
-
Mar 31st, 2005, 08:17 AM
#3
Re: MS Access VBA Code ???
Have a look at the Close and unload events of the form. I think one of them has a cancel long value which when set to other than 1 cancels the closing of the form.
How this works if they close the db, I don't know. If you don't want them closing the form via the menu, then turn off all the menus except you own?
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
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
|