Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to control excel formats on data coming from Access and copyfromrecordset

Status
Not open for further replies.

KevinsHandle

Programmer
Jan 14, 2012
16
0
0
US
I am moving data from access to excel with "copyfromrecordset". It works fine with the exception that the data sometimes comes in formatted as other than what it is. Example: one set has three fields. they are typed in access as Long integer, long integer and percentage. Excel randomly turns them into weird dates Like "2/1/1900". I can format them back but that is kind of defeating the purpose of the automation.

Any Ideas how to fix this??

Thanks for any and all help

Kevin
 
hi,

I seriously doubt that Excel takes your data and "turns them into weird dates," meaning that Excel has CONVERTED your data from one thing to another thing.

This is merely a Number Format! Your data has noth changed!

Simply change your Format Cells > Number Tab > Category GENERAL to DISPLAY numbers. If you were to do this ONE TIME, then NEXT TIME, your formats will be already assigned.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi Skip

Thanks for looking at this. I am not an Excel guy but I did think of preformating the cells. I did it for general, I did it for Number no decimals I did it for percentage where appropriate. It will still display, seemingly at random, dates for the numbers.

If it matters, I am using Access 2003 with 2000 file and Excel 2010.

The people who are going to use this are not big Excel users
 
If your "numbers" are like 1/2 then Excel will convert that to a value other than 1/2!!!

faq68-5827

Is there any way to see what's stored in the table?



Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top