JoshT
Nov 7th, 2000, 10:17 AM
I'm writing some VBA for an Access 2000 DB, and I'm wondering what the heck is in a blank field of a record???
I'm having DAO execute an DELETE SQL statement to clean up the DB by removing all records where the "Name" is blank, but I can't get it to work right.
Code:
Private Sub Form_Unload(Cancel As Integer)
Dim db As DAO.Database
Set db = CurrentDb
db.Execute ("DELETE * FROM [TimeSheetTable] WHERE [TimeSheetTable.Name] = """";")
Set db = Nothing
End Sub
I've tried empty strings ("" and '') and NULL, but they don't match the blank fields. I've also ran the SQL statement in Access's Query designer - it gives me a warning that I'm about to delete 0 rows...
Thanks,
Frustrated Josh
I'm having DAO execute an DELETE SQL statement to clean up the DB by removing all records where the "Name" is blank, but I can't get it to work right.
Code:
Private Sub Form_Unload(Cancel As Integer)
Dim db As DAO.Database
Set db = CurrentDb
db.Execute ("DELETE * FROM [TimeSheetTable] WHERE [TimeSheetTable.Name] = """";")
Set db = Nothing
End Sub
I've tried empty strings ("" and '') and NULL, but they don't match the blank fields. I've also ran the SQL statement in Access's Query designer - it gives me a warning that I'm about to delete 0 rows...
Thanks,
Frustrated Josh