J
John Harvey via AccessMonster.com
Hi
Hope someone can help me out.
I have a form with an underlying subform. Here's the code I've written to
take care of this in the Delete Record command button event procedure.
strSQL = "DELETE * FROM tblWeighting WHERE resourceID=" & Me.resourceID
CurrentDb.Execute strSQL, dbFailOnError
strSQL = "DELETE * FROM tblResources WHERE resourceID=" & Me.resourceID
CurrentDb.Execute strSQL, dbFailOnError
DoCmd.RunMacro macDeleteRecord
The first strSQL deletes the many records of that resource, then it deletes
the actual resource. The first 4 lines worked fine. The underlying records
would be deleted, then the resource; but, on the form the record would
still be there, with #delete in all the text boxes. When the form was
closed, then opened, the records would show properly. So, I created a macro
that closes the form, then opens the form. Everything works great, except I
get a MsgBox that says "Action or Method requires a Macro Name argument."
After I click OK on the MsgBox, the deleted record is gone and everything
is as it should be. However, I need to avoid having this MsgBox appearing.
How can I correct this?
Thanks for any help.
John
Hope someone can help me out.
I have a form with an underlying subform. Here's the code I've written to
take care of this in the Delete Record command button event procedure.
strSQL = "DELETE * FROM tblWeighting WHERE resourceID=" & Me.resourceID
CurrentDb.Execute strSQL, dbFailOnError
strSQL = "DELETE * FROM tblResources WHERE resourceID=" & Me.resourceID
CurrentDb.Execute strSQL, dbFailOnError
DoCmd.RunMacro macDeleteRecord
The first strSQL deletes the many records of that resource, then it deletes
the actual resource. The first 4 lines worked fine. The underlying records
would be deleted, then the resource; but, on the form the record would
still be there, with #delete in all the text boxes. When the form was
closed, then opened, the records would show properly. So, I created a macro
that closes the form, then opens the form. Everything works great, except I
get a MsgBox that says "Action or Method requires a Macro Name argument."
After I click OK on the MsgBox, the deleted record is gone and everything
is as it should be. However, I need to avoid having this MsgBox appearing.
How can I correct this?
Thanks for any help.
John