G
Guest
I use a button on my form to add a record and a quit button for the user to
abandon the entry.
The form has a subform with cascading updates and deletes and a one-to-one
relationship. Each form
is bound to its own table.
The add button code:
Me.AllowAdditions = True
Me.AllowDeletions = True
Me.BCfrm.Form.AllowAdditions = True 'BCfrm is the subform
Me.BCfrm.Form.AllowDeletions = True
DoCmd.GoToRecord , , acNewRec
I add a new record fine.
The quit button code:
'allows each form to delete the record from their table.
Me.AllowDeletions = True
Me.BCfrm.Form.AllowDeletions = True
'turns off system messages
DoCmd.SetWarnings False
'deletes [tbl2Job] record and [tbl2VisitsBC] record.
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
'turns system messages back on
DoCmd.SetWarnings True
Me.AllowDeletions = False
me.AllowAdditions=False
Me.BCfrm.Form.AllowDeletions = False
Me.BCfrm.Form.AllowDeletions = False
Problem: I cannot get this button code to delete the in-process record and
its associated record in the subform.
Before the inclusion of the subform (just one form) the record deleted fine.
I suspect that the
issue is the record in the subform, but do not have the requisite skills to
figure this out.
Will someone take pity on me?
abandon the entry.
The form has a subform with cascading updates and deletes and a one-to-one
relationship. Each form
is bound to its own table.
The add button code:
Me.AllowAdditions = True
Me.AllowDeletions = True
Me.BCfrm.Form.AllowAdditions = True 'BCfrm is the subform
Me.BCfrm.Form.AllowDeletions = True
DoCmd.GoToRecord , , acNewRec
I add a new record fine.
The quit button code:
'allows each form to delete the record from their table.
Me.AllowDeletions = True
Me.BCfrm.Form.AllowDeletions = True
'turns off system messages
DoCmd.SetWarnings False
'deletes [tbl2Job] record and [tbl2VisitsBC] record.
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
'turns system messages back on
DoCmd.SetWarnings True
Me.AllowDeletions = False
me.AllowAdditions=False
Me.BCfrm.Form.AllowDeletions = False
Me.BCfrm.Form.AllowDeletions = False
Problem: I cannot get this button code to delete the in-process record and
its associated record in the subform.
Before the inclusion of the subform (just one form) the record deleted fine.
I suspect that the
issue is the record in the subform, but do not have the requisite skills to
figure this out.
Will someone take pity on me?