Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Cedar Falls, Iowa, USA
    Posts
    268
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DLookup with Null value (A2003)

    I have a DLookup on a field that does not always have a value in it. If that field is blank, I'd like the DLookup to return a blank, a 0 or Null, depending on which of these works on a date value. Is that doable?

    esw

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

    Re: DLookup with Null value (A2003)

    I don't quite understand what you want. What do you mean by "I'd like the DLookup to return a blank, a 0 or Null, depending on which of these works on a date value"?

    Usually,the Nz function can be used in sitations like this. The Nz function has two arguments: Nz(A, [img]/forums/images/smilies/cool.gif[/img] returns A, unless that is Null, then it returns B.

  3. #3
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Cedar Falls, Iowa, USA
    Posts
    268
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DLookup with Null value (A2003)

    The DLookup is in the control source of a combo box and looks up the close date on a work order. If there is no close date, I'd like not to have #Error appear in the control. I was thinking a 0 or blank value would work. I'm not sure which is appropriate on a date field.

    Would you still use the NZ function?

    e

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

    Re: DLookup with Null value (A2003)

    I'm even more confused. It doesn't make sense to have an expression as Control Source of a combo box, for you wouldn't be able to select anything from the list part of the combo box. I think I am missing something here.

  5. #5
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Cedar Falls, Iowa, USA
    Posts
    268
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DLookup with Null value (A2003)

    Let's junk what I've done so far and start fresh. I've a continuous form listing an equipment inventory with an "out of service date" control. I'd like that control populated with work order close dates. I've not used DLookup before. I need a combo box, right? Where do I put the DLookup...in the row source?

    DLookup Dummy

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: DLookup with Null value (A2003)

    I don't understand why you think you need a combobox for that. Why not just bind the control to the underlying date field? I would suggest you post a stripped down version of your database so we can see what you're trying to do.
    Charlotte

  7. #7
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Cedar Falls, Iowa, USA
    Posts
    268
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DLookup with Null value (A2003)

    Talk about trying to make something simple difficult. Thanks for the wake up.

    e

Posting Permissions

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