Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chr and references

Status
Not open for further replies.

BofRossClan

Technical User
Mar 26, 2002
39
0
0
US
I just upgraded from Access 2002 to 2003. In the new version some of my code is not working properly. I have a line of code:

varfirst = DLookup("AuthorFirstName", "authors", "author= " & Chr(34) & varauthor & Chr(34))

The Chr comes up with "Compile Error: Can't find project or library". Is this a broken reference? How do I find the correct reference, or is this code been made obsolete in this version?
 
If you open a module and go to Tools....References, you will see the libraries available. You can look for one that is "missing" and add that. I don't know which library contains the Chr()function, but you can make sure the Visual Basic for Applications and Microsoft DAO 3.6 Object libraries is available.
See if that helps.

Paul
 
I made sure both of those libraries were selected, and I still get the error. The only one showing as missing is 'Microsoft Office XP Web Components', and I can't find a replacement for that one.

When I first converted the database, I got an error that a reference was broken to owc10.dll version 1.1, but I don't find that in the list either.
 
If you just upgraded the same computer then the dll files should still be on your machine. you may have to re-register the files then set the reference. Have you done a search for the dll files?
 
Can you uncheck/check the XP Web Comonents' library and see if it installs? I assume the owc10.dll is the "[blue]O[/blue]ffice XP [blue]W[/blue]eb [blue]C[/blue]omponents library that is missing.
Otherwise, type owc10.dll in google and see if you can find someplace to download that .dll. You can rename the owc10.dll (if you can find it) and save the new dll to that same file.
I found mine in C:\Program File\Common Files\Microsoft Shared\Web Components\10

Paul
 
Hmmm. I unchecked the missing library, and it all started working. Is there a way to avoid going through all this if the program is installed on another computer with a different version? I plan on selling this program.
 
That happened to me as well, the whole Web Components thing that I didn't even need for my db.

In my db's I alwasys launch this code when the db opens. I don't completely understand it (got it from this or another forum I'm sure), but it checks the References:
Code:
        'Fix References
               Dim r As Reference, r1 As Reference
               Dim s As String
    
               ' Look for the first reference in the database other
               ' than Access and Visual Basic for Applications.
               For Each r In Application.References
                  If r.Name <> "Access" And r.Name <> "VBA" Then
                     Set r1 = r
                     Exit For
                  End If
               Next
               s = r1.FullPath
    
               ' Remove the Reference and add it back.
               References.Remove r1
               References.AddFromFile s
    
               ' Call a hidden SysCmd to automatically compile/save all modules.
               Call SysCmd(504, 16483)

So I have an Autoexec Macro which calls a module that has all sorts of stuff in it, this being one of the things.


Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Thanks. I'll give that a try. References is just one of those things I don't quite understand - especially why they are contstantly changing with each version! I'm sure it's just to drive us crazy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top