Problem with line of VBA Code in Macro

A

Aaron C. Shumaker

I'm running a macro in VBA (from MS access) - the macro
debugs when it gets to the line of code displayed below
and gives me the following message: "Compile Error:
Can't find project or library."

The code line that VBA debugs on is:

If Mid(DateAndTime.Value,1,3) = "Jan" Then

"MID" is highlighted. I don't know why this isn't working
because it worked for the past year and a half. Anyone
have any help? Thanks,
--aaron
 
S

Scott Simpson

Try putting writing it like this:

Mid$(DateAndTime.Value,1,3) = "Jan"

See if that works.
 
G

Guest

didn't work unfortunately. any other suggestions?
-----Original Message-----
Try putting writing it like this:

Mid$(DateAndTime.Value,1,3) = "Jan"

See if that works.




.
 
T

Tim Ferguson

"Compile Error:
Can't find project or library."

The code line that VBA debugs on is:

If Mid(DateAndTime.Value,1,3) = "Jan" Then

This sounds like a broken reference: check Tools | References and look for
_any_ library marked as Missing. Either remove it or use the button to
browse for the correct library.

Then recompile.

HTH


Tim F
 

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