Thread: AfterUpdate

    #1
  1. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Sep 2011
    Posts
    37
    Rep Power
    4

    AfterUpdate


    I have a form on which there are two fields I wish to work with.
    I am trying to use AfterUpdate to clear the data from FieldB when FieldA is updated.
    Can anyone help please
  2. #2
  3. Contributing User
    ASP Adventurer (500 - 999 posts)

    Join Date
    Jun 2011
    Location
    South Jersey
    Posts
    544
    Rep Power
    59
    in the AfterUpdate event use:
    Code:
    if me.fieldA &"" = "" then   ' or any other qualifier you may want
      msgbox "You didn't put anything in FieldA" 
    else
      me.FieldB = null
    end if

    Comments on this post

    • MaleNurse agrees
  4. #3
  5. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Sep 2011
    Posts
    37
    Rep Power
    4
    No, that didn't work. I dont think I explained myself well enough either. The complete story is,
    When the field "Medical Date" is updated i wnat the contents of the field ERT Medical to show a Null value.
    Thats a better description
  6. #4
  7. Contributing User
    ASP Adventurer (500 - 999 posts)

    Join Date
    Jun 2011
    Location
    South Jersey
    Posts
    544
    Rep Power
    59
    to show a null value, or acutally be null??
    Code:
    if me.[medical Date] & "" = "" then
        msgbox "Please enter a date."
    else
        me.ERT = null   'use if you want to erase the field
        me.ERT.visible = false  'if you want to hide the field, but not erase the data in it.
    end if
    try to avoid spaces in your fieldnames. it unnecessarily complicates things.
  8. #5
  9. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Sep 2011
    Posts
    37
    Rep Power
    4
    Works perfectly. Thank you
  10. #6
  11. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Sep 2011
    Posts
    37
    Rep Power
    4
    How do I add to yoru reputation mergatigoerr??????
  12. #7
  13. Contributing User
    ASP Adventurer (500 - 999 posts)

    Join Date
    Jun 2011
    Location
    South Jersey
    Posts
    544
    Rep Power
    59
    small star (6 points) under the "SharebThis Comment"

    Comments on this post

    • MaleNurse agrees
  14. #8
  15. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2007
    Location
    Calgary
    Posts
    18
    Rep Power
    0
    Originally Posted by MaleNurse
    I have a form on which there are two fields I wish to work with.
    I am trying to use AfterUpdate to clear the data from FieldB when FieldA is updated.
    Can anyone help please
    Have you tried :

    Private Sub FieldA_AfterUpdate()
    Me.FiledB=Null
    End Sub
  16. #9
  17. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Feb 2013
    Posts
    6
    Rep Power
    0
    I have found random situations that = Null errors out...

    In those situations (if you get any errors) just use = ""

Similar Threads

  1. AfterUpdate - values not calculating
    By jehe in forum Microsoft Access Help
    Replies: 16
    Last Post: April 16th, 2008, 01:07 PM
  2. Do I have to use AfterUpdate?
    By dindigul in forum Microsoft Access Help
    Replies: 4
    Last Post: August 15th, 2007, 03:48 PM
  3. another vbscript - afterupdate
    By nezard in forum Microsoft Access Help
    Replies: 1
    Last Post: September 29th, 2004, 06:47 AM
  4. Please help! - Move AfterUpdate
    By ttellis in forum Microsoft Access Help
    Replies: 5
    Last Post: August 20th, 2004, 10:24 AM
  5. afterupdate event in asp
    By navinkhem in forum ASP Development
    Replies: 1
    Last Post: December 23rd, 2003, 10:00 AM

IMN logo majestic logo threadwatch logo seochat tools logo