Saving on Tabbed Forms

Stemdriller

Registered User.
Local time
Today, 23:21
Joined
May 29, 2008
Messages
187
Hi all

I have a main form which contains customers details.

Within that Main Form I have 6 Tabbed Forms.

A user may look at a Contract number and make a change in only a couple of the Tabbed Forms, but I cannot code it to Prompt the User to Save changes or Not to save changes.

I have tried the following

Private Sub cmdExitNoSave_Click()
If MsgBox("Are you sure you wish to cancel any changes made?", vbOKCancel) = vbOK Then
Me.Undo
DoCmd.Close acForm, "frm_ContractHeader", acSaveNo

Else

Cancel = False
End If
End Sub

Private Sub cmdExitWithSave_Click()

If MsgBox("Any changes have been recorded", vbOKCancel) = vbOK Then
DoCmd.Close acForm, "frm_ContractHeader", acSaveYes

Else

Cancel = False

End If
End Sub

But this just closes the main form (frm_ContractHeader) and saves whatever changes have been made, whether the ExitNoSave or ExitWithSave button has been used.

I have also tried DoCmd.Run Command acCmdUndo but I get an error saying acCmdUndo not ready to be used.

Any suggestions??

Gareth
 
If you have subforms, the subform data is saved right when you move off of the subform. If you have changes on the main form and you move to a subform, the changes are immediate.
 
Look at "DemoSubformChangesA2000.mdb" (attachment, zip).
Open "frmMain" and try.
 

Attachments

Users who are viewing this thread

Back
Top Bottom