View Full Version : Stopping autosave of record


jesus_hairdo
12-04-2001, 03:14 AM
not too sure if this is the correct forum for this, but here we go.
I have a form which has a save record button on it. I want to have the form only save the record when manually saving. and to NOT save it when moving on to a new record or closing the form (ie disable Access's autosave 'feature').

thanks

Jamie

jwindon
12-04-2001, 05:15 PM
I would skin that cat like this:

Set your forms Tab cycle to CURRENT RECORD ONLY. You would need to remove the CLOSE "X" on the form also. The user can tab their little heart out, but until they hit the "SAVE" button..no save. You could code the button to offer "Save Record? or Undo?" and then Me.Undo or goto new record.

Hope that gets you off and running!

jesus_hairdo
12-05-2001, 12:33 AM
cheers for that, sounds like just the job.

thanks

Jamie

wranglers_rock
12-28-2001, 08:29 AM
can I add a question to that I hope I'm not infringing on any forum etiquitte. What about the record saving/new record when you use the scroll button (roller) on the mouse? I tried putting the tab cycle to current record only but it seems to work inconsistently. Thanks.

Pat Hartman
12-28-2001, 09:19 AM
Another method is to create a global (for the form module) variable. Set it to "No" in the onCurrent event and set it to "Yes" in the click event of the Save button. Then in the BeforeUpdate event, check the value and remember to reset it to "No" before exiting the event. If it is "Yes" let the save happen. If it is "No", display a msgbox asking whether or not to save. If the answer is "No", cancel the update event.

David R
01-02-2002, 02:52 PM
Pat,
will this get confused if more than one user is in the table?

David R

Pat Hartman
01-02-2002, 05:06 PM
No. Variables are held in memory on the Client PC.

jesus_hairdo
01-10-2002, 03:46 AM
any chance of a bit of coding of this, (i'm very new to VBA, this would be only my 3rd use of VBA so still not used to syntax)

cheers