Quote:
> > Hello,
> > I have this statement in my code and it prompts me a
> > dialog box that says delete will be performed. Is there a
> > way to perform this in a silent mode.
> > ' set date
> > trancateDate = Date - maxLogDay
> > ' SQL delete string
> > sqlString = " DELETE * " & _
> > " FROM " & errorLogTableName & _
> > " WHERE Date <#" & trancateDate & "#;"
> > DoCmd.RunSQL (sqlString)
> > Or is there any other way to delete some records in a
> > table?
> Dim db As DAO.Database
> Set db = CurrentDb
> db.Execute strSQL
> Set db = Nothing
Just to tag onto Tony's answer, you might want to use
db.Execute strSQL, dbFailOnError
That lets you determine whether or not the SQL succeeded (it'll raise an
error that you can trap the way you trap any other error)
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele