Hi
I have a form, that you enter detials on and when you select a field and enter detials in, it creates the autonumber! Now i believe the database saves this record to the table. If i select the Cancel button instead of Save, i want the entered data to be deleted from the table.
I have tried using the me.undo method, but that doesnt work, i Have tried just entering in the code DoCmd.RunCommand acCmdDeleteRecord but that doesnt delete the record either (i think it could be because the query is looking at two tables so cant delete the record, or i might be way off, all i know is it's not deleting).
I would like to run an SQL statement saying i would like to delete the last record from that table, how do i do this?
Or if anybody has any better ways, im all ears
Many Thanks
I have a form, that you enter detials on and when you select a field and enter detials in, it creates the autonumber! Now i believe the database saves this record to the table. If i select the Cancel button instead of Save, i want the entered data to be deleted from the table.
I have tried using the me.undo method, but that doesnt work, i Have tried just entering in the code DoCmd.RunCommand acCmdDeleteRecord but that doesnt delete the record either (i think it could be because the query is looking at two tables so cant delete the record, or i might be way off, all i know is it's not deleting).
I would like to run an SQL statement saying i would like to delete the last record from that table, how do i do this?
Or if anybody has any better ways, im all ears

Many Thanks