Solved

Format function yields "Undefined function 'format' in expression error"

Posted on 2003-12-02
13
1,056 Views
Last Modified: 2008-02-26

Can anyone help with this somewhat basic question.  Im reading a book about vba for access 2000.  When i try one of their examples, it get a "Undefined function 'format' in expression error".

Here are the specifics:

I am trying to get the month name out of a date in a query.  In the field box, i have: MonthName: Format([DateOrdered], "mmmm").  Seems pretty simple to me, any ideas?  

0
Comment
Question by:elbarro
13 Comments
 
LVL 10

Expert Comment

by:ADSaunders
ID: 9859562
Hi elbarro,
Have you got ALL of Access installed .. Including the scripting support?

Regards .. Alan
0
 
LVL 32

Expert Comment

by:jadedata
ID: 9859645
Hey elbarro!

  Check the menu Tools/References in the VBA Editor window.
  Make sure ALL the required references are check and that NONE show to be "Missing"

regards
Jack
0
 
LVL 5

Expert Comment

by:morpheus30
ID: 9860076
Have you tried:

MonthName(Month([DateOrdered]))
0
 

Author Comment

by:elbarro
ID: 9870587
hey morpheus, you know any reason why what you mentioned worked and the other function didnt?
0
 
LVL 5

Expert Comment

by:morpheus30
ID: 9870719
Now that's baffling.  I know weird stuff happens when a person upgrades from an old version of Access (say Access 97) to a new one (say Access 2000).  Only thing I can think of is maybe the references are incorrectly set.  Following jadedata's instructions above, you should see these references for Access 2000 CHECKED.  If you don't then there is your problem:

Visual Basic for Applications
Microsoft Access 9.0 Object Library
0
 

Author Comment

by:elbarro
ID: 9870744
Are the "references" application wide or mdb wide.  What i mean by this is, if i change them in one mdb, does it mean its changed in all?  or does it only apply to that particular db.

Thanks, Greg
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 5

Expert Comment

by:morpheus30
ID: 9870748
It's changed for all...
0
 

Author Comment

by:elbarro
ID: 9870831
Heh, i dont see Access 9.0 Object library, but there are like 8 VBA dll's... any suggestions
0
 

Author Comment

by:elbarro
ID: 9870841
I guess, im trying to learn from this so that I can figure it out later on.  It seems as if the "Format" command is located in one of these dll's.  However, that particular dll either isnt on my system or isnt loaded.  Am I getting warm?
0
 
LVL 5

Expert Comment

by:morpheus30
ID: 9870877
OK, now we have something!  You don't have Microsoft Access 9.0 Object Library, but maybe you do have Microsoft Access 8.0 Object Library.  That's why you were able to use one function and not the other.

Did you upgrade to 2000 from 97?

0
 

Author Comment

by:elbarro
ID: 9870912
Here's my scoop.  Im using Access XP and reading a book on Access 2000 before I read the next one on advanced Access.  I have never dealt with VB and find it rather unconventional.  Without me getting into too much detail, the upgrade was from the books 2k db to my XP Access.  Im getting a couple other errors from time to time as well with this DB.

Thanks for all your help.
0
 
LVL 5

Accepted Solution

by:
morpheus30 earned 350 total points
ID: 9870979
I see...

If you can do a fresh install of either program (not an upgrade) then this might solve your problems.  By the way, did you try looking for Microsoft Access 10.0 Object Library?  This is the library for Access XP.  You might find that it's there, but because it is UNCHECKED, you'll have to scroll down the window to find it (they are listed alphabetically).  Once you do, all you have to do is check the checkbox and it's ready...


0
 

Author Comment

by:elbarro
ID: 9871020
Thanks for all of your help.  You've answered my question and more.  I've posted another question if your interested under Question Title: how to swap info on reports, but i didnt want to bog down this thread.

Thanks again

Greg
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now