Results 1 to 2 of 2

Thread: Access SQL question

  1. #1

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    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

  2. #2

    Thread Starter
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Nevermind, I overlooked IsNull()...

    Josh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width