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
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Access Error (2000)
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
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.
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.
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.”
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.”
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
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
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.
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.
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
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?
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications