Solved

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

Posted on 2004-09-20
4
509 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 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

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

730 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