Is there any way to make access only save a record when someone clicks on the save command button. We're trying to eliminate the autosave/autoupdate feature so that records aren't altered accidentally.
You will need a boolean flag in your form module. e.g.
Code:
Dim CanSave As Boolean
Private Sub cmdSave_Click()
CanSave = True
If Me.Dirty Then Me.Dirty = False 'Forces an update
CanSave = False
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
Cancel = Not CanSave
End Sub
Private Sub Form_Load()
CanSave = False
End Sub
The example is great but is the "If" statement correct. There is no "end if" ???
Also is Me.dirty suppose to = somthing before you make it equal to false.
EX: IF Me.Dirty= true then
Me.Dirty=false
End if
Also does Cansave dim as global?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.