I need a command in vba to delete the records from my table REPETIRTEL
the moment I close my form. This form does not have this table as the data source, so I need the command to call this table and then disable the delete commit message.
I need a command in vba to delete the records from my table REPETIRTEL
the moment I close my form. This form does not have this table as the data source, so I need the command to call this table and then disable the delete commit message.
First I created a delete query from the REPETIRTEL table with the Delete Query, then I called this query and that's it, it looks like this:
Private Sub Form_Close()
Application.DoCmd.SetWarnings False
DoCmd.OpenQuery "deleteREPETIRTEL", acViewNormal
Application.DoCmd.SetWarnings True
End Sub
First I disabled access messages I called Query Re-enabled the messages.
Another alternative:
Private Sub Form_Close()
Application.DoCmd.SetWarnings False
Application.DoCmd.RunSQL "DELETE * FROM REPETIRTEL"
Application.DoCmd.SetWarnings True
End Sub