How to save data only when the button is clicked? (1 Viewer)

vid

Registered User.
Local time
Yesterday, 17:23
Joined
Feb 4, 2010
Messages
62
Basically the data in a form should get saved only when the user clicks on the SAVE button.

I have seen a lot of posts online about this but i still haven't got a clear answer.

please help!
 

MStef

Registered User.
Local time
Today, 01:23
Joined
Oct 28, 2004
Messages
2,251
Look at "DemoSaveDA2000.mdb" (attachment, zip).
Open Form2 and try.
 

Attachments

  • DemoSaveDA2000.zip
    17 KB · Views: 358

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 01:23
Joined
Sep 12, 2006
Messages
15,718
the thing is, this is perverse behaviour, and is only really applicable with unbound forms.

there are just so many ways data can be saved that it is not really feasible/possible to prevent all of them - and probably not desirable either.
 

missinglinq

AWF VIP
Local time
Yesterday, 20:23
Joined
Jun 20, 2003
Messages
6,420
I agree whole heartedly with the "not desirable" part. Experienced Access users expect a record to be saved without the use of a "save" button. The standard way of handling this would be to have code for a message box in the Form_BeforeUpdate event asking the user if they want to save the record, then dumping it if the response is No, using

Cancel = True
 

MStef

Registered User.
Local time
Today, 01:23
Joined
Oct 28, 2004
Messages
2,251
I agree too. I never use this in my app. If the user write the data,
it means he need this record. I made this "Demo" because Vid asked for this.
 

ghudson

Registered User.
Local time
Yesterday, 20:23
Joined
Jun 8, 2002
Messages
6,194
Experienced Access users expect a record to be saved without the use of a "save" button.

My experience with Access user's is that they do not realize a record will be saved when they move to another record and save changes that they did not intend. Which is why I created my own technique many years ago with my A Better Mouse Trap? sample.
 

HiTechCoach

Well-known member
Local time
Yesterday, 19:23
Joined
Mar 6, 2006
Messages
4,357
My experience with Access user's is that they do not realize a record will be saved when they move to another record and save changes that they did not intend.

I totally agree. This is the biggest complete I get from users of all skill levels with Access.

When I staring working on a new database, the first record in most tables are trashed because of this.

The first thing I do is add buttons for Add, Edit, Save, Cancel, and Delete.

Note: The Save button really does not do a lot but save the record. All of the code work is done in the Before Update event.
 

ghudson

Registered User.
Local time
Yesterday, 20:23
Joined
Jun 8, 2002
Messages
6,194
Yep! All of my forms have custom command buttons. I remove all default navigation and record selector buttons and the control box options for I want total control over what the user will be doing in my forms. Most of my users do not know they are using an Access database for an application that I designed from the beginning.
 

missinglinq

AWF VIP
Local time
Yesterday, 20:23
Joined
Jun 20, 2003
Messages
6,420
Apparently you gentlemen deal with a rather unsophisticated group of users, Access-wise! My condolences to you!:D
 

ghudson

Registered User.
Local time
Yesterday, 20:23
Joined
Jun 8, 2002
Messages
6,194
Apparently you gentlemen deal with a rather unsophisticated group of users, Access-wise! My condolences to you!:D

Quite the opposite! It is the Access power users that I have to be careful of and I do my best to lock everything down so that the users are only able to do what I allow them to do with my Access applications and the data within.
 

HiTechCoach

Well-known member
Local time
Yesterday, 19:23
Joined
Mar 6, 2006
Messages
4,357
It is the Access power users that I have to be careful of ...

I total agree.

I see even more issues with Access developers, who should no better, trashing user's data.

At first the "Power" user's complaint that it is extra steps adding the buttons. But they have all come around to really liking them. They will finally admitted that it has saved them many times from trashing the data. The usually even admitted that they had to fix data more often than they would like to admit before adding the "buttons." They just never would say anything because they did not want to look stupid.
 

SOS

Registered Lunatic
Local time
Yesterday, 17:23
Joined
Aug 27, 2008
Messages
3,514
I had a problem with people editing the first record thinking they were searching for something. So, I implemented it that the form was locked unless it was a new record and to edit something required them to click an UNLOCK FOR EDITING button.

Worked like a charm. :)
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 01:23
Joined
Sep 12, 2006
Messages
15,718
Personally, I dont like some of the ideas here

I hate removing the control box.

I find record selectors extremely useful.

I hate not having a close button - on the odd forms I have removed them for special reasons, I still find it awkward looking for the close mechanism on those forms.

And I hate the binoculars icon and usage - so generally I lock the important fields that users might change, thinking they were navigation options, but provide a separate search box mechanism that simplifies the use of the binocular search mechanism.
 

HiTechCoach

Well-known member
Local time
Yesterday, 19:23
Joined
Mar 6, 2006
Messages
4,357
I hate removing the control box.

I totally agree. I have never understood why anyone would do that as a general rule. It can actually be quick helpful. Like to move a form.

I find record selectors extremely useful.

I totally agree. I have never understood why anyone would do that as a general rule.

I like to stick to the Access standard tools as much as possible. This way is anyone takes any Access training, reads a book, or has already learn how Access works, they can leverage that knowledge.

I hate not having a close button - on the odd forms I have removed them for special reasons, I still find it awkward looking for the close mechanism on those forms.

If the forms are not consistent with the placement of the close button, and do not use the keyboard shortcut, it make is very non user-friendly.

Consistency is key to eliminating the: "a... wkward looking for the close mechanism "

And I hate the binoculars icon and usage - so generally I lock the important fields that users might change, thinking they were navigation options, but provide a separate search box mechanism that simplifies the use of the binocular search mechanism.

I leave the original Find ("binoculars") in working but add my own search mechanism. Again, this way is anyone takes any Access training, reads a book, or has already learn how Access works, they can leverage that knowledge.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 01:23
Joined
Sep 12, 2006
Messages
15,718
sorry boyd

it was the comments above that you add all the extra buttons, and GHudsons comments
that he removed a lot of standard features. I thought you were saying you concurred with this, but re-reading, I see you arent.

Do yuo have a standard placement/colouring for your extra buttons?
 

ghudson

Registered User.
Local time
Yesterday, 20:23
Joined
Jun 8, 2002
Messages
6,194
Just to clarify my design techniques...

I use the standard grey command button color and all button icons are consistently used throughout my applications. I do include a close button on each form for which I am able to control what can happen before and after the form is closed. All my forms with records use the standard icons for the record navigation buttons and common commands and I include my custom record counter in the header of each form. Not a lot of extra effort when I use a template form to begin each project. My design philosophy is to make my applications user friendly while also controlling everything the users can and cannot do within my applications.
 

vid

Registered User.
Local time
Yesterday, 17:23
Joined
Feb 4, 2010
Messages
62
Thanks for all the help everyone :)
 

Users who are viewing this thread

Top Bottom