423,321 Members | 1,167 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,321 IT Pros & Developers. It's quick & easy.

Format function problems

100+
P: 420
I'm having a problem with some customers having a Function error when they run any thing with the Format function in it. The code is
Expand|Select|Wrap|Line Numbers
  1. YEAR: (Format([Params.shoot_date],"yyyy"))
I run it on my machine with not problems. I've also loaded the program onto a customers computer that has Access and if I look at the references I see no broken ones. If I run the program in Access the format function works. If I run it in the runtime using the .accdr It comes up with the error. It's not just the Year: format that has problems it's anything that uses the Format function. Does anybody have any idea what's happening or what I can do to fix this issue.

Thanks for any help.
Mar 13 '18 #1
Share this Question
Share on Google+
9 Replies


PhilOfWalton
Expert 100+
P: 1,293
I have heard of this problem before, and there is a suggestion that you could have say version 2016 runtime and Office 2010 (with or without Access) installed on the same machine, giving some sort of incompatibility.

I can contribute nothing further on this topic, as I have never used Runtime. Might be worth checking out though

Phil
Mar 13 '18 #2

twinnyfo
Expert Mod 2.5K+
P: 2,536
Tom,

First, try a compact and repair of your DB. See if that works. If not, a more extreme, but often helpful, method is to create a new, blank DB and import all objects into that new DB. Compact and Repair, Compile and see if you get the same results.

Please refer to a similar post concerning Access producing strange and unexplainable errors.

Let us know if that hepps!
Mar 13 '18 #3

100+
P: 420
Does anybody know which reference is used for the Format function. I thought I might look and replace the reference with a newer or older one.
It's funny that when I run the program with Access 2010 it works but when I run the Runtime it doesn't. I might try uninstalling the Access 2010 and see if that helps.
I have installed Office 365 on one of the machines that was giving me this problem and after it was installed the Access 2007 runtime worked. Strange!

Thanks
Mar 13 '18 #4

twinnyfo
Expert Mod 2.5K+
P: 2,536
Tom,

AFAIK, the Format() function is a standard function. No reference is needed. Others, please correct me if I am wrong.

If you were trying to automate Excel betwixt different versions of MS Office, I would expect the references to be updated (although you can get around this by declaring those apps explicitly).
Mar 13 '18 #5

NeoPa
Expert Mod 15k+
P: 30,996
CD Tom:
Does anybody know which reference is used for the Format function.
It's the VBA library Tom.

If you're ever curious simply go to The Immediate Pane (Ctrl-G) and type the name of the function you want to know about. Once you have the name there simply open The Object Browser Pane (F2) and you should see your Method in the right-hand pane and the Class in the left. Below both panes is the summary info which includes the full path to the class it's a Member of (The first element of which will always be the library name).
Mar 16 '18 #6

twinnyfo
Expert Mod 2.5K+
P: 2,536
NeoPa,

So, if I understand correctly, "technically speaking" the Format() Function requires the reference to the VBA Library; but, without that reference, you can't program in VBA anyway, so, it's kind of moot?

But, at least now I know how to find what goes with which reference.

Thanks!
Mar 16 '18 #7

NeoPa
Expert Mod 15k+
P: 30,996
TwinnyFo:
So, if I understand correctly, "technically speaking" the Format() Function requires the reference to the VBA Library; but, without that reference, you can't program in VBA anyway, so, it's kind of moot?
That's not quite right my friend.

VBA is a language. It comes with an IDE (Integrated Development Environment) as well as a library of Classes including Methods and other Properties. This particular library is not deselectable from the IDE interface so there's a certain truth in saying they're tied together, but it can also be available for non-VBA use.

The situation where the library is deselected cannot cause VBA to be unusable. It isn't an available option anyway, but if it were, it still wouldn't cause VBA to fail. It would only cause calls to any of the items within that particular library to fail. Does that make sense?

Obviously most VBA code uses that library very heavily so it's been set as non-deselectable.
Mar 16 '18 #8

twinnyfo
Expert Mod 2.5K+
P: 2,536
AS usual.... I continue to learn new things about this stuff.

:-)
Mar 16 '18 #9

NeoPa
Expert Mod 15k+
P: 30,996
We all do. We all do :-)
Mar 17 '18 #10

Post your reply

Sign in to post your reply or Sign up for a free account.