Solved

"Keyword Not Found" -- Several Functions are missing in VBA!!!

Posted on 2004-09-20
4
504 Views
Last Modified: 2008-01-09
Has anyone else run into this problem?

I have a file that I'm trying to write a macro for, but certain functions are simply not working.  Essentially, Access is telling me that functions like "OpenRecordSet", "RecordCount", "NextRecord", etc.  are not recognized functions.  First I checked for spelling errors, misplaced commas, comments, parentheses, quotations.  Nothing is wrong with the syntax.  I decided to test the commands by using one of the examples from the help files.  Much to my surprise, I could not access the help files for ANY of these functions.  All I get is 'Function or Keyword not found.  I dug into the help files directly and managed to unearth the example for the OpenRecordSet function.  I cut and pasted the script directly from the help files into the VBA editor.  I still received the "Keyword Not Found" error.

I finally tried opening one of the sample databases that come with Access (Northwind.mdb).  Wouldn't you know it, the functions work fine.  I'm running the files from the same load of Access, on the same machine.  I even ran them at the same time.  So I imagine there is some driver, or some toggle, setting or command that I need to apply in order to make these functions work in my boss' .mdb file, but I have no idea what it is (ODBC perhaps?) or how to apply it to a file that isn't recognizing these commands, or even the help files for them.

Does anyone know how to make a file recognize these ODBC commands?  I really don't want to have to rebuild the boss' database.   My boss handed me an .mdb file with a deceptively simple task.  (Translation:  Not so simple.)  I just need to apply a macro to a report and get multiple printouts of each record based on a number stored in the record.

I'm posting another question that is similar to the printing question found here... (http://www.experts-exchange.com/Databases/MS_Access/Q_10057464.html).  I'm hoping I can find a few brilliant souls who can help me get the job done, without having to rebuild the boss' DB.

Thanks in advance,
HoloSim

0
Comment
Question by:holosimexchange
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
Data-Man earned 250 total points
ID: 12103380
Are you missing any references?

Open the VB editor and check using Tools | References

If you have a missing reference, all bets are off as to the errors.

You may have a missing DAO or ADO missing reference.

Mike
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 12103483
If you do have missing references and you aren't using those libraries in your database, just uncheck them. If you are, you will need to add them back by browsing to the file that they reference.

You may find that none are listed as missing or broken. If so, just untick one of them, close the references window, reopen it and check it back again. This forces the references to be refreshed so it may resolve the errors.
0
 

Author Comment

by:holosimexchange
ID: 12103554
Data-Man,

     Thanks, going into the references, I found that DAO 3.6 object library was not selected.  Access 9.0 object library was selected (is this the ADO? or is there another).  This has at least convinced Access to recognize the commands again.  Any easy answer as to how these would get unchecked?  I thought they came up by default, and I know for a fact the person who built the mdb file would not have turned them off.  I ask because I'm hoping to prevent this from happening again in the future.  
      Also, do you know if this might prevent others from using being able to use this database (I already have a situation where one of my mdb files, which works great on my Win2K machine, doesn't work at all on someone elses WinXP, even with the same load of Access.)

Thanks Again,
HoloSim
0
 
LVL 18

Expert Comment

by:Data-Man
ID: 12103600
ADO is a separate library...look for Microsoft - ActiveX Data Objects

If should be on your machine.  To download the latest copy from MS go here.

http://www.microsoft.com/downloads/details.aspx?FamilyID=6c050fe3-c795-4b7d-b037-185d0506396c&DisplayLang=en

Mike
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now