J
John S. Ford, MD
I'm using Access 97 and have a form with an embedded subform. The subform
appears in datasheet view so it has no visible controls. I'm trying to code
a button on the main form that will delete the current record of the subform
ie. the record (in datasheet view) that has the cursor on it. I apparently
can't use the DoCmd.RunCommand acCmdDeleteRecord statement from the main
form because it would refer to a record on the main form (not the desired
subform's current record. I've tried code like:
Private Sub cmdDeleteRecord_Click()
Me.sbfctlSubform.Form.DoCmd.RunCommand acCmdDeleteRecord
End Sub
This generates an error that I assume is due to the fact that "DoCmd" isn't
accessible to a subform from a main form.
So how can I do this? Can it be done using DAO recordsets? Any ideas
greatly appreciated!
John
appears in datasheet view so it has no visible controls. I'm trying to code
a button on the main form that will delete the current record of the subform
ie. the record (in datasheet view) that has the cursor on it. I apparently
can't use the DoCmd.RunCommand acCmdDeleteRecord statement from the main
form because it would refer to a record on the main form (not the desired
subform's current record. I've tried code like:
Private Sub cmdDeleteRecord_Click()
Me.sbfctlSubform.Form.DoCmd.RunCommand acCmdDeleteRecord
End Sub
This generates an error that I assume is due to the fact that "DoCmd" isn't
accessible to a subform from a main form.
So how can I do this? Can it be done using DAO recordsets? Any ideas
greatly appreciated!
John