Prompting a user to save changes

PerkinsSlave

New Member
Joined
Feb 1, 2004
Messages
26
I am designing a form that will either retrieve existing records or create new ones (I suppose that's the standard definition of a form, huh? :biggrin: )

I would like Access to default to NOT saving any changes/additions UNLESS a user clicks a "Save" button. If they attempt to navigate away from the record they tried to change, I would like to pop up a message box asking them if they'd like to save changes.

This seems like it should be fairly easy. The only form settings I've found are AllowAdditions/Edits, etc, but I don't believe those commands have an option for "prompt."

Thanks!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I think if you buld your form based off of a table, you wouldn't be able to stop this very readily. My suggestion would be to setup a form with no association to a table, build your controls and a save button, which you can then prompt off of. Then when the button is pressed update the table using DOA.

PS-Your assumptions on the form was wrong, you can create a form that doesn't have any association to a query or table. That's what this method does.
 
Upvote 0
PS-Your assumptions on the form was wrong, you can create a form that doesn't have any association to a query or table. That's what this method does.

<SIGH> You're right of course... this is what happens when I sit in front of my computer for too long staring at the same code!

I went to bed and no sooner than my head hit the pillow then I figured out a solution. It's rather sloppy, but it works. I built my form off a temporary table which was identical to the permanent table. I then gave the user a "Save" or "Cancel" option. The "Save" option calls an append query that places data from the temp table into the permanent one, then deletes it from the temp table. Very simple... but my brain was fried!

Thanks for the reply, tho! :oops:
 
Upvote 0
Nothing wrong at all with that method.
Been there, done that.

Yes, if I had to do it again, I might have tried a different method (now) but then again, maybe not. Depends on what it needs to do.
 
Upvote 0
mdmilner said:
Nothing wrong at all with that method.
Been there, done that.

Yes, if I had to do it again, I might have tried a different method (now) but then again, maybe not. Depends on what it needs to do.

Been there, done that.

????What the hell was I thinking about when I did that???

:eek:

Have you been there?
 
Upvote 0
Hullo. What you are wanting to do is possible with your new friend DIRTY. :D Seriously, when a user makes changes in a form, a property DIRTY gets set to TRUE. Just have a snippet of code attached to the nav out options that checks the value of DIRTY. Should get you where you need to go.

HTH (y)

P
 
Upvote 0
Hullo. What you are wanting to do is possible with your new friend DIRTY . :D Seriously, when a user makes changes in a form, a property DIRTY gets set to TRUE. Just have a snippet of code attached to the nav out options that checks the value of DIRTY . Should get you where you need to go.

Thanks P. I am using your suggestion to prompt for changes on another form.

I've just got to say that this board is excellent. While there is no substitution for trial and error, and I seem to have developed an affinity for Access book-buying, it is very nice to post a question and receive such helpful replies. I am forever indebted to my coworker Elysyn, for first introducing me to this forum.

You guys are great!!!!!!!!! (y)
 
Upvote 0

Forum statistics

Threads
1,221,672
Messages
6,161,199
Members
451,688
Latest member
Gregs44132

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top