T
Tony Williams
I have a form based on a table with two subforms based on other tables. The
three tables involved are linked. I realise that when I move the focus from
the main form to the sub form the record is automatically saved. I already
have a message box that pops up on the BeforeUpdate of the main form that
asks if the user wants to save the record as I understand the BeforeUpdate
kicks in as the focus moves from the main form to the subform. I have a
command button on the form that is a Close button. I want to give the user
the option to delete the record at this point. I can't use Me.Undo because
by this time the record has already been saved. So basically I want a
message box to popup that says "Are you sure you want to save this record"
if they click Yes the form is closed if they click No the record is deleted
and the form is blank ready for a new input.
I think the code should go something like
If vbYes = MsgBox("Are you sure you want to create this record?", 36, "New
Record") Then
Docmd.Close
Else
(record deleted and form blank for new input)
What I need is the code that does the last bit in brackets for me
Hope I've explained my problem
TIA
Tony Williams
three tables involved are linked. I realise that when I move the focus from
the main form to the sub form the record is automatically saved. I already
have a message box that pops up on the BeforeUpdate of the main form that
asks if the user wants to save the record as I understand the BeforeUpdate
kicks in as the focus moves from the main form to the subform. I have a
command button on the form that is a Close button. I want to give the user
the option to delete the record at this point. I can't use Me.Undo because
by this time the record has already been saved. So basically I want a
message box to popup that says "Are you sure you want to save this record"
if they click Yes the form is closed if they click No the record is deleted
and the form is blank ready for a new input.
I think the code should go something like
If vbYes = MsgBox("Are you sure you want to create this record?", 36, "New
Record") Then
Docmd.Close
Else
(record deleted and form blank for new input)
What I need is the code that does the last bit in brackets for me
Hope I've explained my problem
TIA
Tony Williams