#Type! Type mismatch? on a report for Null values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DanicaDear
    Contributor
    • Sep 2009
    • 269

    #Type! Type mismatch? on a report for Null values

    I have 4 sets of options buttons (radio buttons) on a form. When the user orders something they select a button to further identify the product. (We make numbered plates, and frequently they order a series of odd, even, or all.)
    The options group stores the value 1, 2, or 3 in the table (Data Type: Text). However, on a report (where I am making them a receipt), I want it to show what they actually selected: "odd, even, or all".
    This is how I have done it:
    I have 4 unbound text boxes, named Text96, Text98, Text99, and Text100. The control source is set to
    Code:
    =Choose([SeriesType1],"Odd","Even","All")
    =Choose([SeriesType2],"Odd","Even","All")
    =Choose([SeriesType3],"Odd","Even","All")
    =Choose([SeriesType4],"Odd","Even","All")
    This displays the information I want them to see. And it works, by the way. ;-)

    However, in many cases, the user only orders one series, so the last three options groups would be Null. So in my text boxes shown above, I get this "#Type!" message in the textbox on the report/receipt. I don't want my customer to see that. How can I supress it, hide it, remove it, get it GONE!? :-)

    Thanks so much in advance.
    Last edited by NeoPa; Apr 17 '14, 08:01 PM. Reason: Merged code to make easier to read.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32653

    #2
    Use Nz() to set a default (or what to do when Null) value :
    Code:
    =Choose(Nz([SeriesType1],4),"Odd","Even","All",Null)
    =Choose(Nz([SeriesType2],4),"Odd","Even","All",Null)
    =Choose(Nz([SeriesType3],4),"Odd","Even","All",Null)
    =Choose(Nz([SeriesType4],4),"Odd","Even","All",Null)
    Nicely asked question BTW. Dead easy to understand and answer :-)
    Last edited by NeoPa; Apr 17 '14, 08:02 PM.

    Comment

    • DanicaDear
      Contributor
      • Sep 2009
      • 269

      #3
      NeoPa!!!!!!!!!! It worked on the first try!!!!
      Not that I should be surprised by your wisdom but when things work on the first try...let's just say that isn't my usual way. :-D
      Thank you so very much (as always!!)

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32653

        #4
        That's probably down to the question Danica. It's hard to overstate how important the question is in determining the speed at which a good answer comes back at you.

        Your questions are very much better than when you started and you're (deservedly) reaping the benefits of that now :-)

        Comment

        Working...