H
Haydnw
Please can someone help me with some VBA to delete the
*selected* record in a subform. I have a button on the
subform which is supposed to delete the selected record.
The problem is that whenever I press it, the first record
(ie at the top of the screen) is deleted.
I have tried several ways to delete the record, including:
1) Using the wizard for the command button and
choosing 'Delete record'
2) Running a SQL statement to delete the record which
matches the ID of the selected record (this deleted two
records at a time!!)
3) Using 'SendKeys' to emulate a user pressing the delete
key when the required record is selected
4) Using DoCmd.DeleteRecord (or whatever it is!)
I did find something in an old newsgroup post which
referred to using RecordsetClone but was trying something
else at the time and now can't find it again! Any ideas
would be very gratefully received!
Regards,
H
*selected* record in a subform. I have a button on the
subform which is supposed to delete the selected record.
The problem is that whenever I press it, the first record
(ie at the top of the screen) is deleted.
I have tried several ways to delete the record, including:
1) Using the wizard for the command button and
choosing 'Delete record'
2) Running a SQL statement to delete the record which
matches the ID of the selected record (this deleted two
records at a time!!)
3) Using 'SendKeys' to emulate a user pressing the delete
key when the required record is selected
4) Using DoCmd.DeleteRecord (or whatever it is!)
I did find something in an old newsgroup post which
referred to using RecordsetClone but was trying something
else at the time and now can't find it again! Any ideas
would be very gratefully received!
Regards,
H