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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference between Format and VBA.format Access 2010 1

Status
Not open for further replies.

Rich8541

Technical User
Dec 10, 2010
14
US
Hello, What's the difference between VBA.format and just Format in Access VBA. I'm opening some 2007 version db's in 2010 and I get an undefined function error, so I preceded the format and date built-in functions with VBA and they worked. I remember having this problem in 2003 and the quick fix was to install VB on those boxes, turns out we were just missing a file. I'll be searching the net for some info and will post back if I can. Thanks, Jim
 
There is no difference, it is just the full qualifier. The format function is in the vba library and you can usually omit the library name when writing code. You do this all the time with access objects.

Dim frm as Access.form
or
Dim frm as Form

In some cases you need the full qualifier when the names are reused in different libraries
dim rs as dao.recordset
dim rs as adodb.recordset
The two recordsets have different properties and methods.

You likely have a missing or broken reference. Check your references. This can manifest in other native functions not working as well. When your code compiles it reads the function "format" and then needs to decipher what that is. If you have the full qualifier it knows exactly where to go. With out it, it looks through the list of checked references in the order listed. VBA tends to be low on the list alphabetically and if there is a broken reference then it hits that before getting to VBA.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top