R
Richard
I am using Access 2000 and Windows XP.
I have a form that I need to generate a pop up box to say "Do you want to
save changes" with options "Yes" or "No" for users to click on. If they
choose "No" then changes are undone. This only needs to happen when closing
the form, moving to a new/another record or saving updating and not for every
single change.
I have this code at the moment which I have put in the Form properties:
Function changessave()
Select Case MsgBox( _
"Changes have been made - Do you want to save?" _
, vbYesNo _
, "Continue with Save?")
Case vbYes
DoCmd.save
Case vbNo
DoCmd.RunCommand acCmdUndo
End Select
End Function
The problem is I also have a sub form (addresses) which is refreshed when
the 'Establishment' field (on the main form) is changed or just reselected.
Unfortunately this refreshes the whole form as well and triggers the
changessave function, which is not what I want.
Here is the refresh code:
Function Refresh()
On Error GoTo Refresh_Err
DoCmd.RunCommand acCmdRefresh
Refresh_Exit:
Exit Function
Refresh_Err:
MsgBox "Error"
Resume Refresh_Exit
End Function
Any help with this is most appreciated.
Thank you.
I have a form that I need to generate a pop up box to say "Do you want to
save changes" with options "Yes" or "No" for users to click on. If they
choose "No" then changes are undone. This only needs to happen when closing
the form, moving to a new/another record or saving updating and not for every
single change.
I have this code at the moment which I have put in the Form properties:
Function changessave()
Select Case MsgBox( _
"Changes have been made - Do you want to save?" _
, vbYesNo _
, "Continue with Save?")
Case vbYes
DoCmd.save
Case vbNo
DoCmd.RunCommand acCmdUndo
End Select
End Function
The problem is I also have a sub form (addresses) which is refreshed when
the 'Establishment' field (on the main form) is changed or just reselected.
Unfortunately this refreshes the whole form as well and triggers the
changessave function, which is not what I want.
Here is the refresh code:
Function Refresh()
On Error GoTo Refresh_Err
DoCmd.RunCommand acCmdRefresh
Refresh_Exit:
Exit Function
Refresh_Err:
MsgBox "Error"
Resume Refresh_Exit
End Function
Any help with this is most appreciated.
Thank you.