Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Syntax error (Access 2000)

    I want to set automatically all fields that have no value to 0 value,but i receive a syntax error
    How can i do that ?


    Dim StrDummy As String
    StrDummy = "UPDATE School SET Notes = 0 WHERE Notes = """
    CurrentDb.Execute StrDummy

  2. #2
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Syntax error (Access 2000)

    Try this , it may help :


    StrDummy = "UPDATE School SET Notes = 0 " WHERE Notes = """

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Syntax error (Access 2000)

    If a field has no value, it is Null, not "". So try

    StrDummy = "UPDATE School SET Notes = 0 WHERE Notes Is Null"

    Note that you have to use "Is Null", not "= Null".

Posting Permissions

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