Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Setting a value to Null in an Update Statement (Access 2000)

    Hi, I am trying to set a field of a value to Null in an update statement. I am sure it is possable to set a value to Null, but I am not sure how. This is what I have in my current update statement.

    SQLUpdate = "UPDATE OrderedProducts SET ProductStatus = Datefilled = " & Null & ", " & var_ProductStatus & ", QtyOrdered = " & var_QtyOrdered & "" _
    & " WHERE ProductID = " & var_ProductID & " AND InvoiceID = " & var_InvoiceID

    DoCmd.RunSQL SQLUpdate

    Ideas are always welcome [img]/forums/images/smilies/smile.gif[/img]

    Thanks

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

    Re: Setting a value to Null in an Update Statement (Access 2000)

    You should keep the Null within the quotes; if you put it outside the quotes it will do a disappearing act. Also, you cannot use SET ProductStatus = DateFilled = ...
    To set ProductStatus to Null, use Set ProductStatus = Null.

  3. #3
    3 Star Lounger
    Join Date
    Apr 2003
    Location
    Calgary, Alberta
    Posts
    327
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting a value to Null in an Update Statement (Access 2000)

    Alright [img]/forums/images/smilies/smile.gif[/img]

    Thanks Again Hans [img]/forums/images/smilies/smile.gif[/img]

Posting Permissions

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