473,387 Members | 1,590 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,387 software developers and data experts.

DoCmd.OutputTo weirdness...

218 Expert 100+
Using standard DoCmd.OutputTo syntax to export a simple dataset to an Excel
worksheet.

Works well, but......

we have a list of text codes (YD, 2M, 7G, etc) which come across into the
cells ok - all except codes like '11A' and '10A' and these come into Excel as eg '0.458333333' and '0.416666666666667' respectively.

Reformatting as text/general has no effect at all.

Is there something I'm missing about the output process which would cure this quirk?

Any ideas gratefully received

TIA

Steve
Nov 8 '06 #1
8 2642
NeoPa
32,556 Expert Mod 16PB
Do you actually export these strings in quotes?
It seems Excel will interpret the 11A & 10A as 11 or 10 times some strange value A (.0416666666666667)
I don't know what A stands for, but it is similar to Excel converting '1E2' to a value equal to 1 * E^2.
I can't for the life of me remember what E is but it's a logarithmic value used as an alternative to 10 in certain situations.
Anyway, this is an irritating by-product of Excel where it is always trying to second guess your data and makes specifying it explicitly difficult.
Try adding quotes into the data stream, hoping that Excel will process them as signifying string data rather than general data which may be string or numeric.
Nov 8 '06 #2
cyberdwarf
218 Expert 100+
Hi, NeoPa,

Yup, works that way!

Wish my second guesses were that clever <G>

Thx

Steve
Nov 8 '06 #3
NeoPa
32,556 Expert Mod 16PB
I've had problems importing into / from Excel before ;)
Nov 9 '06 #4
Killer42
8,435 Expert 8TB
I've had problems importing into / from Excel before ;)
Howdy NeoPa. I'd just like to clear up a technical point here. 1E2 means 1 * 10^2, not 1 * E^2.
This could cause confusion if you ever need to use it.
Nov 9 '06 #5
NeoPa
32,556 Expert Mod 16PB
Hi Killer.
I know I'm vague on this one so you're probably right here - but I thought there was another logarithmic base other than 10 that's commonly used.
But when E is used it refers to base 10?
Nov 9 '06 #6
Killer42
8,435 Expert 8TB
Hi Killer.
I know I'm vague on this one so you're probably right here - but I thought there was another logarithmic base other than 10 that's commonly used.
But when E is used it refers to base 10?
You can do logarithms to base e (written as lowercase, I believe - not that I would claim to understand it) but in various products such as Excel they just use "E" as a short way to indicate "exponential".

This may be just a convention chosen by Microsoft, rather than a mathematical term.
Nov 9 '06 #7
cyberdwarf
218 Expert 100+
To NeoPa et al

A short postscript...

11A is interpreted in Excel as being a time type (11AM) and this value is then translated into a decimal value.

Why? Don't ask me, but it is definitely not intuitive IMHO, especially since most of the data in the same column is clearly text type...

Ho hum!

Steve
Nov 9 '06 #8
NeoPa
32,556 Expert Mod 16PB
Nice one CyberDwarf.
That's exactly the sort of thing I was expecting but didn't know the details.
Thanks for the info.

And, No - Excel can be very strange at times, but it is designed to get people going with the most basic understanding - rather than to work intuitively for people who actually know what they're doing.
It sells better that way :(.

Killer,
Thanks for that too - that reminds me of what I once knew... A senior moment ;).
Nov 9 '06 #9

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

Similar topics

0
by: Victor Kaiser | last post by:
I am using DoCmd.OutputTo to allow users to save Access reports in snapshot format or other desired formats. Once the user selects the desired format and clicks "OK", a dialog box appears that...
2
by: deko | last post by:
This code is behind a button that exports the contents of a query ("qryXL_Tx") to an Excel spreadsheet. It works fine the first time, but will not run a second time. When I go to look at my...
0
by: Frank Barnhart | last post by:
We have an application which runs Access under automation. With Access 97, the app included this line to send a report to a text file: myAccessObject.DoCmd.OutputTo acOutputReport, ,...
0
by: Robert Langen | last post by:
I'm calling an Access XP application from an Outlook XP appointment form. Everything works, but the lines DoCmd.OutputTo acOutputReport, "testreport", acFormatRTF, "c:\test.rtf", False Docmd.Quit...
4
by: tmountjr | last post by:
I've got a user who's trying to export a text file with unicode formatting. When he exports it as straight ascii, some of the foreign characters (mostly just accent marks and the like - no...
1
by: Ryan | last post by:
Hello. I was hoping that someone may be able to assist with an issue that I am experiencing. I have created an Access DB which imports an Excel File with a particular layout and field naming. ...
1
by: Simon | last post by:
Dear reader, With the DoCmd.OutputTo ...... you have the possibility to write a report to an external location. In case the external location is an existing file the DoCmd is not...
2
by: jmartmem | last post by:
Greetings, I have several Access 2007 reports that I regularly export to individual PDF flat files on a web server. I've successfuly created a module sub to export the reports using the...
16
by: g diddy | last post by:
Hi, I have used the Docmd.outputto function in various places in my code but for some reason all code that comes afterwards, even msgbox doesn't show. I was just wondering if there is anything that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.