remove records

Y

Yvonne

Hi I need to delete all records from a table in my
database. I have a button on a table maintenance form
which I would like to run the code from. Only data
should be removed.

my table is tblplacenames

thanks

Yvonne
 
N

Nikos Yannacopoulos

Yvonne,

Put this code in the button's On Click event:

cnt = DCount("*", "tblplacenames")
strSQL = "DELETE * FROM tblplacenames"
CurrentDb.Execute strSQL
MsgBox cnt & " Records deleted.", vbInformation, "Place Names table"

HTH,
Nikos
 
Top