Add "save" button?

KrakowiAneczka

New member
Local time
Today, 21:02
Joined
Apr 12, 2011
Messages
7
Hello!
I would like to add "save" button in my form.
How do I do that? Is there an easy way to do that?

Please note that I'm just beginer and I don't know much about Access :/

Thank you in advance for your help :)
 
Open the form in design view, click the 'Button' icon in the ribbon, click your form to place it, hit 'Cancel' in the wizard that pops up, click the button and label it 'Save'.

Now the real question is--What exactly is this save button to do?
 
Lmao... plog... you're horribly mean.

For a more serious answer, you should do exactly what plog said, except go through the wizard. It will guide you through the steps to create a save button.
 
The key here is to understand when Access saves. Access will save your record of a bound form when you move to a new record, close the form, or specifically ask it to. So, while you can have a save button, it isn't particularly necessary unless you have a specific type of flow in mind. That would be my question. How are the users going to be using your form?
 
FYI, Access automatically saves the current record if you move to another record or close the form. Experienced Access users know this and don't expect to have to click a 'save' button.

Linq ;0)>
 
To me Save is a button I add so my users feel better :)

Also might need it on unbound forums.
 
Unbound forms would be handled differently, of course. But the Save button on a bound form can essentially be a pretty thing to have (and to make it consistent as you say) even though it might not be necessary. But you can kick it all off with this code behind it:

If Me.Dirty Then Me.Dirty = False

which will kick off a save if there is anything to save and if there isn't, it won't even attempt to save.
 
Haha...you've lost me here ;)
Well, it seems that records are saving automaticly.
And yes, I wanted "save" button to save my data base records.

I was more looking for easy way of creating function buttons.

Thank you anyway :)
 
Thank you all for your reply :)

I wanted to add "save" button as (maybe it's hard to belive) users who will be using it know even less about data base than I do.

I'm using Access 2003 and I haven't got ribbon. When I created button (from toolbar options) wizard didn't pop up.

The expresion: "If Me.Dirty Then Me.Dirty = False" killed me!!!
I seriously thought there was a joke when I red it for the first time (I was trying to look for an answer before I posted my question) :)
 
The expresion: "If Me.Dirty Then Me.Dirty = False" killed me!!!
I seriously thought there was a joke when I red it for the first time (I was trying to look for an answer before I posted my question) :)
That's true, it would look like a joke to someone who isn't all that experienced with coding.

crazysmile.jpg
 
:D
So...how do I add my "save" button? Is there an easy way or I have to go through learning resources?
 
In the Control Toolbar on 2003 there is a cursor button (hover text = select options) next to that is a button that looks like a magic wand with 3 dots (hover text = control wizard) click that box so that it turns orange and then wizards will appear on your control features.
 
Hurray!!!
I've got my "save" button :D
and also added "Look up" button :D

I will be posting more queries (I've already got one ;) ) so please be patient with me - I am newbie :D

Cheers!
 
No problemo :) i am a more advanced newbie lol.. I'm just happy to finally help someone :)
 
assuming you are using bound (ie data-aware) controls, then it's not so much a save button you need, as a do not save button

access tries real hard to save records and changes at every oppportuinity, without being asked.

Other than pressing escape, it's fairly hard to not save.
 
So are you saying by pressing escape on a form it stops it from saving?

If so that's extremely handy for me and I sha'll just run a macro that presses escape for me so that it doesn't save ? If that's possible?
 
So are you saying by pressing escape on a form it stops it from saving?

If so that's extremely handy for me and I sha'll just run a macro that presses escape for me so that it doesn't save ? If that's possible?

The code would look like;
Code:
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
Or simply use the Button Wizard, and select Record Operations and Undo Record
 
The code would look like;
Code:
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
Or simply use the Button Wizard, and select Record Operations and Undo Record
Well, I would suggest NOT using the DoMenuItem code because a simple

Me.Undo

would take care of it (and is more self-documenting).
 
it isn't that it doesn't save, exactly

every control carries an "oldvalue" as well as its current value, until the record is saved.

so pressing escape undoes your edits. it first cancels an edt within a control being edited, and puts it back to it's oldvalue. If no control is being edited it undoes all edits to a record, and reverts every control back to its original value.

so you can still force a record save eg records/save - but the point is that the record has not being changed.

one way of seeing this, is to add record selectors to a form. it shows as a bar on the left, with an arrow against the active record (each record in a continuous form)

if the record has changed the arrow changes to a pencil.

there are now numerous ways of saving the record. write code to save record. move to another record. close the form. menu item, records, save. even click the pencil.

there are numerous ways of cancelling the save. press esc to cancel the edits. run code to undo the changes.

because there are so many ways to save a record, it is far better to teach your users how access works, rather than add a superfluous button to do it. If oyu do, they might not click the save button, and be surprised that the record still changed!
 
If oyu do, they might not click the save button, and be surprised that the record still changed!
But if you handle the decision on whether to actually save or not within the form's Before Update event, it is moot as to how you implement because it ALL flows through there if there is data added or changed.
 

Users who are viewing this thread

Back
Top Bottom