Hi All,
I am trying to close a form with a subform.
I enter data in the main form and then the subform.
The main form has a save btn with an on click event which includes at the end of code
If Me.Dirty then
Me.Dirty = false
DoCmd.Close
DoCmd.OpenForm "FormName"
however the Form will only close and open the required form if I remove the two "Dirty" Code lines.
Anyone see where I am going wrong?
I am obviously trying to ensure that the data is saved on both the main and subforms using the If Me.Dirty......code
Thanks,
I am trying to close a form with a subform.
I enter data in the main form and then the subform.
The main form has a save btn with an on click event which includes at the end of code
If Me.Dirty then
Me.Dirty = false
DoCmd.Close
DoCmd.OpenForm "FormName"
however the Form will only close and open the required form if I remove the two "Dirty" Code lines.
Anyone see where I am going wrong?
I am obviously trying to ensure that the data is saved on both the main and subforms using the If Me.Dirty......code
Thanks,