Thread: Update Query
View Single Post
  #2  
Old May 28th, 2010, 01:58 AM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Update Query

On Thu, 27 May 2010 14:41:39 -0700, SageOne
wrote:

How can I change this code to make the "Occupied" field null? This is just a
small part of a larger peice of code but this is whats causing my issue.


It's confusing and perhaps inconsistant, but you must use the IS NULL syntax
in criteria (= NULL will NOT work); but you must use = NULL in an Update
clause (IS NULL will NOT work). Try

DoCmd.RunSQL "UPDATE [On Hold Records Table 2] SET [On Hold Records Table
2].Occupied = null" & _
"WHERE ((([On Hold Records Table 2].Identifier)='" & Identifier & "'));"

This assumes that Identifier is a text type field; it doesn't matter what
datatype Occupied is, if it's nullable (i.e. not Required and not a Yes/No
field).
--

John W. Vinson [MVP]