G
Guest
Hi there,
I have a subform sfReidProductDrawings_DataEntry in a form frmAddNewDrawing.
I use a command button in the form intended to clear all inputs in the
subform first (because if the primary key field isn't filled with some value,
Access won't let me close the form, and also this can prevent unfinished
inputs from being saved when user decides to discontinue with data entry
during half way) before close the form and open another form
frmReidProductDrawings. But there seems to be something wrong with the
"dirty" and "undo" function -- compile error "Method or data member not
found" appears. How do I fix this? Many thanks
--- start of code ---
Private Sub cbReturnToDWGSearch_Click()
' Clear all fields entered in sfReidProductDrawings_DateEntry
If Me.sfReidProductDrawings_DataEntry.Dirty Then
Me.sfReidProductDrawings_DataEntry.Undo
End If
DoCmd.Close acForm, Me.sfReidProductDrawings_DataEntry.Name
' Close frmAddNewDrawing
DoCmd.Close acForm, "frmAddNewDrawing", acSaveYes
' Open frmReidProductDrawings
DoCmd.OpenForm "frmReidProductDrawings"
' Maximize the form
DoCmd.Maximize
End Sub
--- end of code ---
I have a subform sfReidProductDrawings_DataEntry in a form frmAddNewDrawing.
I use a command button in the form intended to clear all inputs in the
subform first (because if the primary key field isn't filled with some value,
Access won't let me close the form, and also this can prevent unfinished
inputs from being saved when user decides to discontinue with data entry
during half way) before close the form and open another form
frmReidProductDrawings. But there seems to be something wrong with the
"dirty" and "undo" function -- compile error "Method or data member not
found" appears. How do I fix this? Many thanks
--- start of code ---
Private Sub cbReturnToDWGSearch_Click()
' Clear all fields entered in sfReidProductDrawings_DateEntry
If Me.sfReidProductDrawings_DataEntry.Dirty Then
Me.sfReidProductDrawings_DataEntry.Undo
End If
DoCmd.Close acForm, Me.sfReidProductDrawings_DataEntry.Name
' Close frmAddNewDrawing
DoCmd.Close acForm, "frmAddNewDrawing", acSaveYes
' Open frmReidProductDrawings
DoCmd.OpenForm "frmReidProductDrawings"
' Maximize the form
DoCmd.Maximize
End Sub
--- end of code ---