Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-09-20
4
Medium Priority
?
517 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
Data-Man earned 1000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

610 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