Link to home
Start Free TrialLog in
Avatar of holosimexchange
holosimexchange

asked on

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

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... (https://www.experts-exchange.com/questions/10057464/Print-Varying-Number-of-Labels.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

ASKER CERTIFIED SOLUTION
Avatar of Data-Man
Data-Man
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of holosimexchange
holosimexchange

ASKER

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
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