Access and VBA

M

MWE

I have just started doing some VBA programming in Access.
I am pretty skilled using VBA in Excel, Word and Outlook.
My problem is pretty basic. Access does not seem to
recognize many VB functions during compile/execute. For
example, the statement

MsgBox "Today's date is " + Format(Date,"dd-mmm-yyyy")

runs fine in, say, Excel (as it should). But in Access, I
get an error message "Can't find project or library" the
Date function within the Format function is hilited.
Both functions (format and date) are "known" by the
Object browser in Access, but unknown in code.

What am I doing wrong?

Thanks
 
S

Steve Schapel

MWE,

The first thing to check would be the References. In any code module,
select References from the Tools menu. Is anything marked "MISSING:"?

By the way, your expression should have a & instead of a + i.e.
MsgBox "Today's date is " & Format(Date,"dd-mmm-yyyy")
 

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