• Access Error (2000)

    Author
    Topic
    #400676

    Hi ,

    I appear to be getting an access error , but cannot work out for the reason for the error.

    I would appreciate it if you could inform me as to how l could go about resolving the error message l am getting.

    Thanks
    Justin

    Viewing 2 reply threads
    Author
    Replies
    • #783224

      What is the error message you’re getting? You’ve shown us a location but not told us what the error is. Is Str is breaking because of a bad reference?

      • #783234

        Yes, this is the case.

        What l am trying to do is to use a drop down list to try and retrieve document number details from a table.
        If you see the example you will see what l mean.

        It works ok in all other forms and table but l am baffled as to what is causing this error when l try and create a drop down menu.

        Regards
        Justin

        • #783245

          In the Visual Basic Editor, select Tools | References…
          If there is a reference starting with MISSING, write down which one it is, then clear its check box.
          Repeat if necessary for other references.
          Click OK.
          Try Debug | Compile to see if the problem has gone away. If not, you may have to hunt for the file(s) noted as missing, then set new references.

          • #783251

            The error still is there after trying what you mentioned.

            I don’t understand what you mean by new references, repeat if necessary for other references and missing file(s).
            Can you explain what you mean by these things?

            Thanks
            Justin

            • #783275

              Did you have any missing references, and if so, what were they?

              A reference tells VBA to use a set of objects, properties, methods etc. For example, if you use Access to control Word, you need a reference to the Word object library. Sometimes, these references don’t work any more, for example because new software has been installed, or because the database is opened from another PC, with a different setup. Non-working references are marked MISSING: in the Tools | References… dialog.

            • #783299

              Please can you tell how l can go about resolving this issue of missing referenes.

              When you mean different setup , what sort of setup are you implying?
              what can l check in the setup order to resolve this problem of a different setup?

              Regards
              Justin

            • #783307

              You still haven’t told me if there WERE any missing references, and if so, which ones they were.

            • #783321

              I don’t understand what you mean by missing references.

              I have attached the references which l have ticked in the check box.

              Regards,
              Justin

            • #783325

              As I wrote in post 342702, “Non-working references are marked MISSING”. Your screenshot doesn’t show any reference as MISSING. If you haven’t cleared the check box for any of the references since you got the error, missing references are NOT the cause of your problem.

              So we get back to Charlotte’s question in the first reply in this thread: “What is the error message you’re getting? You’ve shown us a location but not told us what the error is.”

            • #783326

              As I wrote in post 342702, “Non-working references are marked MISSING”. Your screenshot doesn’t show any reference as MISSING. If you haven’t cleared the check box for any of the references since you got the error, missing references are NOT the cause of your problem.

              So we get back to Charlotte’s question in the first reply in this thread: “What is the error message you’re getting? You’ve shown us a location but not told us what the error is.”

            • #783515

              If whatever is in Combo21 is not a number, do not use Str function. The Str function is used to convert a number to a string. If the data being evaluated is not numeric, you’ll get a Type Mismatch error (Err 13). For example, if the combobox illustrated in screen shot is Combo21, this expression:

              ? Str(“GH/L/400”)

              results in Type Mismatch error. Also, Str is a somewhat archaic function – if the return value is a positive number, the string returned by function includes a leading space for the sign of the number. The recommended newer functions to use in place of Str are the CStr or Format functions. Recommend either eliminate Str if Combo21 value is not numeric, or use CStr in place of Str so you don’t get the leading space. Example from Immediate window:

              ? Str(400), Len(Str(400))
               400           4 
              ? CStr(400), Len(CStr(400))
              400            3

              Note leading space returned by Str, and difference in length. This may cause errors if using value to locate a record.

              HTH

            • #783830

              This appeared to resolve the problem and the form is now working.

              Many thanks for your help.

              Justin.

            • #783831

              This appeared to resolve the problem and the form is now working.

              Many thanks for your help.

              Justin.

            • #783516

              If whatever is in Combo21 is not a number, do not use Str function. The Str function is used to convert a number to a string. If the data being evaluated is not numeric, you’ll get a Type Mismatch error (Err 13). For example, if the combobox illustrated in screen shot is Combo21, this expression:

              ? Str(“GH/L/400”)

              results in Type Mismatch error. Also, Str is a somewhat archaic function – if the return value is a positive number, the string returned by function includes a leading space for the sign of the number. The recommended newer functions to use in place of Str are the CStr or Format functions. Recommend either eliminate Str if Combo21 value is not numeric, or use CStr in place of Str so you don’t get the leading space. Example from Immediate window:

              ? Str(400), Len(Str(400))
               400           4 
              ? CStr(400), Len(CStr(400))
              400            3

              Note leading space returned by Str, and difference in length. This may cause errors if using value to locate a record.

              HTH

            • #783322

              I don’t understand what you mean by missing references.

              I have attached the references which l have ticked in the check box.

              Regards,
              Justin

            • #783308

              You still haven’t told me if there WERE any missing references, and if so, which ones they were.

            • #783300

              Please can you tell how l can go about resolving this issue of missing referenes.

              When you mean different setup , what sort of setup are you implying?
              what can l check in the setup order to resolve this problem of a different setup?

              Regards
              Justin

            • #783276

              Did you have any missing references, and if so, what were they?

              A reference tells VBA to use a set of objects, properties, methods etc. For example, if you use Access to control Word, you need a reference to the Word object library. Sometimes, these references don’t work any more, for example because new software has been installed, or because the database is opened from another PC, with a different setup. Non-working references are marked MISSING: in the Tools | References… dialog.

          • #783252

            The error still is there after trying what you mentioned.

            I don’t understand what you mean by new references, repeat if necessary for other references and missing file(s).
            Can you explain what you mean by these things?

            Thanks
            Justin

        • #783246

          In the Visual Basic Editor, select Tools | References…
          If there is a reference starting with MISSING, write down which one it is, then clear its check box.
          Repeat if necessary for other references.
          Click OK.
          Try Debug | Compile to see if the problem has gone away. If not, you may have to hunt for the file(s) noted as missing, then set new references.

      • #783235

        Yes, this is the case.

        What l am trying to do is to use a drop down list to try and retrieve document number details from a table.
        If you see the example you will see what l mean.

        It works ok in all other forms and table but l am baffled as to what is causing this error when l try and create a drop down menu.

        Regards
        Justin

    • #783225

      What is the error message you’re getting? You’ve shown us a location but not told us what the error is. Is Str is breaking because of a bad reference?

    • #783355

      Just a suggestion here, but if your combo box is alpha-numeric (which, according to your form sample it appears to be) then the STR() function is trying to make a string out of a string and, although A97 wasn’t too picky about this, A2K might take issue with it. Have you tried removing the STR() and seeing if this helps?

    Viewing 2 reply threads
    Reply To: Access Error (2000)

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

    Your information: