Solved

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

Posted on 2003-12-02
13
1,071 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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
 
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Documents and settings folder 30 78
Archiving Access table older than 6 months 9 39
Turn off MS Access Default=0 for Numerics 6 27
combo box query 6 8
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…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

831 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