Results 1 to 4 of 4
  1. #1
    mainerain is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Location
    Maine, USA
    Posts
    146

    Update query to replace blank fields with Null

    Is it possible to replace blank fields with null in an update query via query design?

    Alternately, how would i write an IIf using (Is Not Null) AND (does not contain a blank field)? I want to write only if the field is not blank and is not null.

    Thanks

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,117
    In Access blank is (usually) Null. You also have the Zero Length String "" which is not the same and some use erroneously in VBA to make a control look blank:
    Code:
    Me.txtMyControl="" 'Should actually use Me.txtMyControl=Null
    .

    So maybe you can explain what you really need to do with this query. If you do have a bunch of records that have a ZLS in a field simply put that (="") in the "Criteria:" row in query design and use Null in the "Update To:" row.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    mainerain is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Location
    Maine, USA
    Posts
    146
    use Null in the "Update To:" row ---- PERFECT! thanks

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,117
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Need to update some blank fields
    By Dave14867 in forum Queries
    Replies: 9
    Last Post: 09-05-2019, 08:53 AM
  2. Replies: 1
    Last Post: 06-11-2016, 05:46 AM
  3. Replies: 3
    Last Post: 06-07-2012, 07:05 AM
  4. Importing text file with blank fields changes to null
    By Egoyret in forum Import/Export Data
    Replies: 9
    Last Post: 11-10-2011, 01:51 PM
  5. Replies: 5
    Last Post: 03-20-2010, 08:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums