CHR function in VBA

  • Thread starter Matthew de Rouville
  • Start date
M

Matthew de Rouville

I am having trouble getting the Chr function to work in Access 2000
(9.0.2720). I have VBA code with the Chr function. When I try to run it,
the function is highlighted in the VBA editor and the following message
comes up: "Compile Error. Can't find project or library."

The code works in Access 2002 (10.3409.3501) SP-1.

What I am trying to do is insert a carriage return and line feed in a memo
field. I am using chr(13) & chr(10), which works on the Access 2002
machine.

Any ideas? Thanks.

Matt
 
M

Matthew de Rouville

I found the references and saw several "Visual Basic for Application" ones;
I checked them all. I got an error message about a naming confict, but my
macro works. Thanks.
 
W

Wayne Morgan

In the bottom part of the References window you should see the path to the highlighted
reference. The one for the correct VBA in Access 2002 is

C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL

Adjust for which drive your Windows installation is on. To get the path, you can type

?References("VBA").FullPath

in the Immediate Window (Ctrl+G). A long path is frequently cut short in the References
window.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top