473,385 Members | 1,347 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Format function problems

489 256MB
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
9 1720
PhilOfWalton
1,430 Expert 1GB
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
3,653 Expert Mod 2GB
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
CD Tom
489 256MB
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
3,653 Expert Mod 2GB
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
32,556 Expert Mod 16PB
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
3,653 Expert Mod 2GB
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
32,556 Expert Mod 16PB
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
3,653 Expert Mod 2GB
AS usual.... I continue to learn new things about this stuff.

:-)
Mar 16 '18 #9
NeoPa
32,556 Expert Mod 16PB
We all do. We all do :-)
Mar 17 '18 #10

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

Similar topics

3
by: Jean | last post by:
Hi, I have a query that contains the following in the WHERE part of the query: WHERE....Format(IIf(nz()<>0,, IIf(nz()<>0,, IIf(nz()<>0,, ))),"0.0") AS Körperhöhe,....
2
by: ethoemmes | last post by:
Hi I am trying to use the below functions to return the month for a given date. I want the month displayed as Jan for 01 so I wrapped the Month function in the Format function. Month:...
2
by: MLH | last post by:
Can the Format$ function be used to format 42397136 to "42,397,136" ?
10
by: KJ | last post by:
Hello, Why does this not work? txtMoney.Text.Format("#,##0.00") If I type 100 in txtMoney, it returns #,##0.00 I have never gotten the format function to work in .NET.
4
by: Steve Long | last post by:
Hello, I'm encountering a bug, or user error, with the Format function and I'm wondering if someone can either straighten me out or confirm the bug. I'm passing in a Date to the Format function...
4
by: Lee | last post by:
In VB6 you could use the format function to format strings using the @ and ! symbols. for example format("LEE", "!@@@@@@@@") would left align the string "LEE" to the number of spaces allowed in the...
3
by: bob | last post by:
In vb6 you could say s = Format(s, "!") to force text to upper case in the format function. I've searched the vb.net help system and can't find any help on formatting text. There's plenty of help...
6
by: thi | last post by:
Hi, Just wondering whether there is any filesize format function in c#? The reason i ask because i want to display the file size just like windows e.g. 100 KB, 1MB, 1GB etc... I am kind of...
7
by: veer | last post by:
Hi i used the following format function in vb6.0 it works fine Format(DTPFromDate & " 00:00:00", "dd/mm/yyyy HH:MM:SS AMPM") but when i use same format function in vb.net it shows output like...
8
by: Conan Kelly | last post by:
Crossposted: microsoft.public.dotnet.languages.vb microsoft.public.sqlserver.integrationsvcs Hello all, In XL 2003's VBA, I could use the format function to change "11SEP2008" (a string)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.