Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    text box's previous value (XP)

    In the before_update event of a text box I need to get both the new and old value of the text box. I'm sure I remember that there is a previous value property but I don't seem to be able to get the syntax right and it is not in the intellisense property drop down list..

    Can anyone please tell me the syntax and on a slightly different note whether the precious value survives when you go to a add a new record.

  2. #2
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: text box's previous value (XP)

    found it - OldValue !!!!
    but does it survive an add new record?

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: text box's previous value (XP)

    The syntax is oldvalue.

    From my limited testing just now, the value is lost when you move to a different record, or to a new record.
    Regards
    John



  4. #4
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: text box's previous value (XP)

    Thanks John, I could have run a few tests myself but I'm really pushed for time, so thankyou.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: text box's previous value (XP)

    John is correct. OldValue always refers to the current record. When the user moves to another record, OldValue is reset.

  6. #6
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: text box's previous value (XP)

    Thanks guys, I'll keep doing it the way I always have, put the values to variables and then go to add record.

    Stepping through the code I get the error "You can't use Goto Record in design mode..." works OK when running though. just makes it hard to debug.

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: text box's previous value (XP)

    Yes, there are some actions that don't work in single-step mode.

    Depending on the situation, you could set a breakpoint on the line after the one you use to go to a new record. You can then inspect the values of variables.

  8. #8
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: text box's previous value (XP)

    Great idea, thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •