Solved

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

Posted on 2003-12-02
13
1,044 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
Comment Utility
Hi elbarro,
Have you got ALL of Access installed .. Including the scripting support?

Regards .. Alan
0
 
LVL 32

Expert Comment

by:jadedata
Comment Utility
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
Comment Utility
Have you tried:

MonthName(Month([DateOrdered]))
0
 

Author Comment

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

Expert Comment

by:morpheus30
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 5

Expert Comment

by:morpheus30
Comment Utility
It's changed for all...
0
 

Author Comment

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

Author Comment

by:elbarro
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

743 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

19 Experts available now in Live!

Get 1:1 Help Now