Results 1 to 5 of 5
  1. #1
    Join Date
    May 2017
    Posts
    17

    AfterUpdate question please

    In a record in a subform on a form, I need to empty just one field called LICENCESTATE in the record. The following AfterUpdate code in a field called STATE works fine i.e. If FAMILY "BUPRESTIDAE" Then LICENCESTATE = Null. Access then happily clears the LICENCESTATE field. But code that I need to run to clear the LICENCESTATE field if two conditions are met, that is, if the field called FAMILY does not equal "BUPRESTIDAE" and also if the field called RESERVE is empty, Access does not clear the LICENCESTATE field. My code is If FAMILY "BUPRESTIDAE" And RESERVE = "" Then LICENCESTATE = Null. Any suggestions? Many kind thanks, Allen

  2. #2
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Is reserve field null?

    If so have you tried isnull(reserve)= true instead of reserve = “”

  3. #3
    Join Date
    May 2017
    Posts
    17
    Hi Andy - that worked fine, many kind thanks! (Any idea why that worked?) Cheers, Allen

  4. #4
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Simple. A null field is just that. It has no value assigned to it. A field which has been assigned “” has a zero length text.

  5. #5
    Join Date
    May 2017
    Posts
    17
    Terrific! Thanks again Andy!

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

Similar Threads

  1. MS Access vba AfterUpdate coding question.
    By Allen Sundholm in forum Forms
    Replies: 10
    Last Post: 05-25-2017, 04:01 AM
  2. AfterUpdate not firing
    By newvb in forum Forms
    Replies: 4
    Last Post: 09-29-2011, 04:55 AM
  3. AfterUpdate event help
    By 10 Gauge in forum Forms
    Replies: 11
    Last Post: 09-08-2011, 10:04 AM
  4. AfterUpdate not updating
    By P5C768 in forum Programming
    Replies: 6
    Last Post: 06-10-2010, 02:31 PM
  5. BeforeUpdate and AfterUpdate Question
    By gsurfdude in forum Programming
    Replies: 0
    Last Post: 04-03-2008, 07:56 AM

Tags for this Thread

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