Results 1 to 3 of 3

Thread: oldValue Help

  1. #1
    Join Date
    Mar 2003
    Location
    UK
    Posts
    71

    Unanswered: oldValue Help

    i'm probably being really dense, but it's the end of a very long day and I can't work out why this is not working (that i'm i'm not very good at vba!). Can anyone please tell me why the following code does not work?

    If ctl.OldValue = Null Then
    Mgmt = ""
    Else
    Mgmt = ctl.OldValue
    End If

    wher mgmt is a string i want to save the old value of the control into and ctl is a control on a form - if it is not null (as it won't let me save a null into a string). This code doen't recognise if the ctl.oldvalue is null. why is this?

    thanks, em.xx

  2. #2
    Join Date
    Apr 2003
    Location
    Santa Barbara, CA
    Posts
    67

    Re: oldValue Help

    Originally posted by emma_com
    i'm probably being really dense, but it's the end of a very long day and I can't work out why this is not working (that i'm i'm not very good at vba!). Can anyone please tell me why the following code does not work?

    If ctl.OldValue = Null Then
    Mgmt = ""
    Else
    Mgmt = ctl.OldValue
    End If

    wher mgmt is a string i want to save the old value of the control into and ctl is a control on a form - if it is not null (as it won't let me save a null into a string). This code doen't recognise if the ctl.oldvalue is null. why is this?

    thanks, em.xx
    try using any or part of these:

    If isnull(ctl.OldValue) or len(trim(ctl.oldvalue)) = 0 or ctl.OldValue = "" Then

  3. #3
    Join Date
    Mar 2003
    Location
    UK
    Posts
    71
    thanks, the isnull(ctl.oldvalue) worked.

Posting Permissions

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