Hi, I thought I found a great command in RunSQL, but....
In my Unload event for a form, I added some clean-up code:
Private Sub Form_Unload(Cancel As Integer)
If Not IsNull(Me.ID.Value) And Not IsEmpty(Me.ID.Value) Then
DoCmd.RunSQL "delete * from tblStarDudes where id=" & Me.ID.Value
End If
End Sub
When it reached the delete, a msg popped up to confirm deletion of a number of records equal to everything in my table (1307 rows). I tried to run this as a query, and found that "ID" is not actually a column in my table. (When I correct the column name, it tries to delete the expected 0/1/2/etc. records. I sure don't want to rely on this command, if a mistake could end up in all my data being deleted!)
So...if this query is apparently invalid, can anyone shed some light on why or how it would be trying to delete all my records?
Thanks!