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
Solved

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

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

839 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