Solved

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

Posted on 2003-12-02
13
1,080 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
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.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 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