• Debug stepping missing statement that seems correc

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Debug stepping missing statement that seems correc

    Author
    Topic
    #353214

    Post deleted by jp2558

    Viewing 1 reply thread
    Author
    Replies
    • #516010

      Hello,
      Have you tried to use ISNULL as in:
      –> If ISNULL(Me![CreditCardNumber]) Then
      Null has given me headaches but I always forget the workings of Null before the next use.
      Good Luck

      • #516016

        Dana’s suggestion is a good one. You can’t test for anything being equal to Null, because Null represents an absence of a value and the comparison will always return false. You have to use the IsNull function for that purpose.

    • #516021

      Thank You, Thank You, Thank You. This has fixed the problem and now the cursor goes where it should depending on the field in error. How did you (both Dana & Charlote) learn these things? Where can I find the suggested syntax for such statements so that I don’t keep chasing my tail using what appears to be acceptable code?

      • #516028

        I agree – remembering how to work with nulls takes some getting used to (although as I said in a previous message, explicit numeric nulls can be extremely useful in certain circumstances). It is documented in the online docs (although you might need some psychic talent to realize beforehand what you should be looking up ) – see “Comparison Operators” in the online docs.

        When you need to work with nulls, keep the function nz(…) in mind; very handy where you do want to treat null as zero (or any other chosen value) in a specific place in your code.

      • #516134

        Well, it helps when you start with Access 1.0 the day it’s released and “grow up” with it as it evolves!

      • #516289

        The best place for finding things like that is the WOPR lounge. By trying to understand the questions asked and seeing the answers to them you learn a lot. And you may be able to help someone else too.

    Viewing 1 reply thread
    Reply To: Reply #516021 in Debug stepping missing statement that seems correc

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel