Access and VBA

  • Thread starter Thread starter MWE
  • Start date Start date
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
 
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")
 
Back
Top