Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: AfterUpdate

Results 1 to 9 of 9
Share This Thread →
  1. #1
    MaleNurse is offline Contributing User
    Join Date
    Sep 2011
    Posts
    36
    Rep Power
    3

    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
    meratigoerr's Avatar
    meratigoerr is offline Contributing User
    Join Date
    Jun 2011
    Location
    South Jersey
    Posts
    544
    Rep Power
    58
    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

  3. #3
    MaleNurse is offline Contributing User
    Join Date
    Sep 2011
    Posts
    36
    Rep Power
    3
    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

  4. #4
    meratigoerr's Avatar
    meratigoerr is offline Contributing User
    Join Date
    Jun 2011
    Location
    South Jersey
    Posts
    544
    Rep Power
    58
    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.

  5. #5
    MaleNurse is offline Contributing User
    Join Date
    Sep 2011
    Posts
    36
    Rep Power
    3
    Works perfectly. Thank you

  6. #6
    MaleNurse is offline Contributing User
    Join Date
    Sep 2011
    Posts
    36
    Rep Power
    3
    How do I add to yoru reputation mergatigoerr??????

  7. #7
    meratigoerr's Avatar
    meratigoerr is offline Contributing User
    Join Date
    Jun 2011
    Location
    South Jersey
    Posts
    544
    Rep Power
    58
    small star (6 points) under the "SharebThis Comment"

  8. #8
    pebbleslr is offline Registered User
    Join Date
    Jan 2007
    Location
    Calgary
    Posts
    18
    Rep Power
    0
    Quote Originally Posted by MaleNurse View Post
    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

  9. #9
    numus is offline Registered User
    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 = ""

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

Similar Threads

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

ASP Free Advertisers and Affiliates