DELETING RECORDS!!

Milan

Registered User.
Local time
Today, 13:03
Joined
Feb 17, 2002
Messages
85
I HAVE A TABLE WHICH IS BOUND TO A FORM. I NEED TO DELETE ALL RECORDS IN THE TABLE THAT HAVE BEEN CREATED YESTERDAY, THROUGH CODE. THE DATE(YESTERDAY) WOULD BE ON THE FORM IN AN UNBOUND CONTROL. ANYIDEAS!!!

MANY THANKS
 
Create a delete query with the required date in the criteria anbd run it on some event, then requery your form.
 
Try,

Dim db as database
Dim sql as string

set db=currentdb

sql="DELETE * FROM tblYourTable WHERE fldDate = '" & Me.[YourUnboundControl] & "'"

db.Execute sql

db.close
 

Users who are viewing this thread

Back
Top Bottom