X X Oct 14, 2003 #1 Can anyone help me to figure out how to delete all the records in a table from a form? Thank you for any help. X
Can anyone help me to figure out how to delete all the records in a table from a form? Thank you for any help. X
P PC Datasheet Oct 14, 2003 #2 Put this code in the OnClick event of a button on your form: DoCmd.SetWarnings False DoCmd.RunSQL ("DELETE * FROM NameOfTable;") DoCmd.SetWarnings False
Put this code in the OnClick event of a button on your form: DoCmd.SetWarnings False DoCmd.RunSQL ("DELETE * FROM NameOfTable;") DoCmd.SetWarnings False
H Hilo Oct 14, 2003 #3 Use the code type before but last set warnings should be set to True so it reads
P PC Datasheet Oct 14, 2003 #4 Yes, Thanks. I copied and pasted but forgot to change False to True in the last line of code. Appreciate you catching this!
Yes, Thanks. I copied and pasted but forgot to change False to True in the last line of code. Appreciate you catching this!
T TC Oct 15, 2003 #5 Also the form should Me.Requery TC PC Datasheet said: Yes, Thanks. I copied and pasted but forgot to change False to True in the last line of code. Appreciate you catching this! Click to expand...
Also the form should Me.Requery TC PC Datasheet said: Yes, Thanks. I copied and pasted but forgot to change False to True in the last line of code. Appreciate you catching this! Click to expand...