A97 QBF question...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MLH

    A97 QBF question...

    When entering a criteria into the QBE grid like this one...

    [Forms]![frmDMV1stLttr_T ype_Other]![ColorFilter]

    I intend for the query to return rows where the value
    in the field being examined is a string like "blue". But
    if the [ColorFilter] control on the form is a combo-box
    who's value hasn't been chosen yet, then

    [Forms]![frmDMV1stLttr_T ype_Other]![ColorFilter]

    evaluates to something other than the string name
    of a color. I don't know what it evaluates to, but I
    do know that it prevents the query from displaying
    any records.

    What I'm trying to do is to return ALL vehicle records
    unless the color filter combobox on the form has a
    value of say "red", in which case I want the query
    to return only records for red vehicles.
  • Trevor Best

    #2
    Re: A97 QBF question...

    MLH wrote:[color=blue]
    > When entering a criteria into the QBE grid like this one...
    >
    > [Forms]![frmDMV1stLttr_T ype_Other]![ColorFilter]
    >
    > I intend for the query to return rows where the value
    > in the field being examined is a string like "blue". But
    > if the [ColorFilter] control on the form is a combo-box
    > who's value hasn't been chosen yet, then
    >
    > [Forms]![frmDMV1stLttr_T ype_Other]![ColorFilter]
    >
    > evaluates to something other than the string name
    > of a color. I don't know what it evaluates to, but I
    > do know that it prevents the query from displaying
    > any records.
    >
    > What I'm trying to do is to return ALL vehicle records
    > unless the color filter combobox on the form has a
    > value of say "red", in which case I want the query
    > to return only records for red vehicles.[/color]

    Try:

    Like Nz([Forms]![frmDMV1stLttr_T ype_Other]![ColorFilter],"*")

    --
    [OO=00=OO]

    Comment

    • MLH

      #3
      Re: A97 QBF question...

      <censored>
      Trevor, you're a genius. Worked like a charm. Many thx.
      xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxx
      [color=blue]
      >
      >Try:
      >
      >Like Nz([Forms]![frmDMV1stLttr_T ype_Other]![ColorFilter],"*")[/color]

      Comment

      • MLH

        #4
        Re: A97 QBF question...

        Nz really is useful here. Is it new with A97?
        I don't remember ever seeing it or hearing
        about it in Access 2.0.

        Comment

        • Trevor Best

          #5
          Re: A97 QBF question...

          MLH wrote:[color=blue]
          > Nz really is useful here. Is it new with A97?
          > I don't remember ever seeing it or hearing
          > about it in Access 2.0.[/color]

          You're really rattling my memory now, asking about what was introduced
          into something 8 years ago :-)

          Yes, I think it was introduced in 97 although it could have been in 95
          but I (and quite a few others) reverted back to v2.0 when 95 came out.

          I do remember writing my own Nul2Zero() function in Access 2.0

          How come you've only just upgraded to a version that had it's official
          MS support withdrawn about 4 or 5 years ago?

          --
          [OO=00=OO]

          Comment

          • MLH

            #6
            Re: A97 QBF question...

            <chop>
            That's it then. If you wrote your own, without a doubt, it wasn't
            there. I didn't remember seeing it. Nice little add'n they did there.

            xxxxxxxxxxxxxxx xxxxxx
            [color=blue]
            >
            >I do remember writing my own Nul2Zero() function in Access 2.0
            >
            >How come you've only just upgraded to a version that had it's official
            >MS support withdrawn about 4 or 5 years ago?[/color]

            Comment

            • Trevor Best

              #7
              Re: A97 QBF question...

              MLH wrote:[color=blue]
              > <chop>
              > That's it then. If you wrote your own, without a doubt, it wasn't
              > there. I didn't remember seeing it. Nice little add'n they did there.[/color]

              Not necessarily <g>

              I also wrote my own routine to add a number of days, weeks or months to
              a date, taking into account leap years and Y2K, etc (pretty good for
              back in 94/95) as I had done this before in COBOL.

              Only later I found out Access had a DateAdd() function :-\

              --
              [OO=00=OO]

              Comment

              • MLH

                #8
                Re: A97 QBF question...

                That is a bummer![color=blue]
                >
                >I also wrote my own routine to add a number of days, weeks or months to
                >a date, taking into account leap years and Y2K, etc (pretty good for
                >back in 94/95) as I had done this before in COBOL.
                >
                >Only later I found out Access had a DateAdd() function :-\[/color]

                Comment

                Working...