473,387 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to avoid default "can't save form at this time" message?

I have non-computer skilled users entering data into a form. There
are certain ranges of values which, if they enter them, make no sense
in the application, but I can't test them until they try to close out
the form, in which case I can look at the entire set of values and see
if they're OK. So, I have this code.

for the "Before Update" event:

if (their variables are inappropriate) then
msgbox "You've entered bad variables (or some such message),
go back and fix them", vbexclamation
cancel = true
end if
end sub

This works fine, except that the user gets the following message
(which I want suppressed):
"You can't change the record at this time. If you close this object
now, all the data changes you have made will be lost. Do you want to
close the databases object anyway?"
YES NO
The default is "yes," which I don't want them to get.
I don't want them to get this message, because it happens rarely and
the users don't understand it. I just want my "cancel=true" statement
to kill the update process and return them to the form, without any
further word from Bill Gates. How do I do that?
Thanks. Pete Brady
Nov 13 '05 #1
2 7941
Hi Pete

If you have users who find this message mildly annoying, ask them whether
they would prefer Access to just silently lose their entry without telling
them. Microsoft is giving them the choice: they can go back and fix the
entry, or throw the entry away and get out of there. That's a pretty useful
choice.

They only get that choice if they try to close the form when it contains an
unsavable entry. You can try to work around that by disabling the Close
button on the form, building a custom menu so they can't choose Close from
the File menu or switch views from the View menu, or apply a filter or sort
from the Records menu, apply a custom toolbar to remove all the problem
buttons, reprogram the keystrokes such as Ctrl+F4 and Alt+F4 with an
AutoKeys macros, and run API calls to remove the close button from the main
Access window.

Or you could programmatically set module-level flags that let you cancel the
UnLoad event of the form and generate even more annoying message boxes and
end up corrupting the database as frustrated users who can't get out of
their form terminate Access with the Windows Task Manager or by switching
off their database.

Or, you could add a Cancel button to your form to give them another way out:
If Me.Dirty Then Me.Undo
DoCmd.Close acForm, Me.Name

BTW, there is a serious bug with the Close action that *does* cause it to
silently lose what the user entered if it cannot be saved:
http://allenbrowne.com/bug-01.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Paul Brady" <pt*****@aol.com> wrote in message
news:2c********************************@4ax.com...
I have non-computer skilled users entering data into a form. There
are certain ranges of values which, if they enter them, make no sense
in the application, but I can't test them until they try to close out
the form, in which case I can look at the entire set of values and see
if they're OK. So, I have this code.

for the "Before Update" event:

if (their variables are inappropriate) then
msgbox "You've entered bad variables (or some such message),
go back and fix them", vbexclamation
cancel = true
end if
end sub

This works fine, except that the user gets the following message
(which I want suppressed):
"You can't change the record at this time. If you close this object
now, all the data changes you have made will be lost. Do you want to
close the databases object anyway?"
YES NO
The default is "yes," which I don't want them to get.
I don't want them to get this message, because it happens rarely and
the users don't understand it. I just want my "cancel=true" statement
to kill the update process and return them to the form, without any
further word from Bill Gates. How do I do that?
Thanks. Pete Brady

Nov 13 '05 #2
On Fri, 22 Jul 2005 09:51:37 +0800, "Allen Browne"
<Al*********@SeeSig.Invalid> wrote:
Hi Pete

If you have users who find this message mildly annoying, ask them whether
they would prefer Access to just silently lose their entry without telling
them. Microsoft is giving them the choice: they can go back and fix the
entry, or throw the entry away and get out of there. That's a pretty useful
choice.


Allen, Thanks for your reply. I know you realize this, but my users
don't find the message "mildly annoying," but rather, completely
mystifying, and they get blown away when they see some of the weird
and convoluted messages Microsoft produces. So, in this case I myself
gave them the choice to save their "bad" variables or go back, and
this choice worked well, except that the Microsoft message now comes
in on top of my more "friendly" message. I guess we will just have to
live with it. Maybe I should print a message that says something
like,
"You IDIOT! You can't have someone's birthdate later than today's
date!" (Incidentally, I catch that one right away when the leave the
Birthdate control field, well before they try to close out the form.)

I have printed your reply and will see if I can manage to live with
the way things are. Thanks. Pete
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tom LeBold | last post by:
What is the default time out on an Active Server Page?
2
by: Kit Truong | last post by:
Hello, I have an asp page that produces output from a database. This allows a simple way for the user to save the data to a text file by going to File->Save as... The default save as options...
27
by: Curious Angel | last post by:
I have a resume in PDF format and I want anyone who LEFT-OR-RIGHT clicks the link to force the file to be saved, and in any event _not_ opened. Since the PDF will be in his cache in any event, I...
6
by: jer | last post by:
I have created a subroutine that opens a report in design view, modifies the report (adds text boxes and grouping levels, etc.) then opens in preview mode. I want to be able to close the report...
1
by: welles.lo | last post by:
Hi all, I found that the default "can grow" in Crystal Reports 10 is different from the one in Crystal Report 9. In version 9, when "can grow" is disable, the words in the field are chopped...
6
by: ZRexRider | last post by:
I've been reading the newsgroups and most of the solutions for this message are simple and obvious but unfortunately don't solve my problem. I have an MS-Access 2002 ADP application that...
0
by: zhif | last post by:
What will the potential reason cause the following two error messages. 2007-04-13-10.41.26.994282-240 I117470C515 LEVEL: Error PID : 57806 TID : 1 ...
3
by: Jon Davis | last post by:
I've migrated my development workstation from 32-bit Windows Server 2003 to Windows Vista Ultimate x64. I added my .NET web applications under development to IIS. I configured the apps to use a...
11
by: moltendorf | last post by:
Alright, another question to pin on the experts. :D I have an issue with "this" keyword in this case. The way I got around it before was to use a window property, but in this case I'm trying to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.