Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA Code question (2000)

    I am using the following code to update the status field on a form. IIf IsNull(rstOut!Status) Then
    If rstOut!SFePlatform_Indicator = "Yes" Then
    rstOut!Status = "Enrolled"
    Else
    rstOut!Status = "Prospect"
    End If
    End If

    They only want if eplatform = yes then status = enrolled.
    Can I put :
    Else
    rstOut!Status = Null

    They will be selecting other options from a dropdown list. The above code will only affect those records where the status field is null - am I correct? So, if eplatform_indicator = yes then status = enrolled else null will not affect those records where the status has something in it? rst!OutStatus is Null or = Null - I wasn't sure of the right syntax.

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

    Re: VBA Code question (2000)

    If I understand you correctly, you want to leave Status unchanged if it is already filled in (not null). If Status is null AND SFePlatform_Indicator = "Yes", then Status should be set to "Enrolled". If Status is null and SFePlatform_Indicator is not equal to "Yes", Status should remain null. You don't have to do anything in the latter situation.

    The code for this is:

    If IsNull(rstOut!Status) And rstOut!SFePlatform_Indicator = "Yes" Then
    Out!Status = "Enrolled"
    End If

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Code question (2000)

    Perfect - thanks Hans....

Posting Permissions

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