I have a file in Excel 2010 that has fields with numbers rounded to the nearest dollar. The value has cents in it, but it is just formatted to only show whole dollars. However, I wish to import the cents into an Access 2010 table as well. I currently use the following command to import the worksheet:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
strTable, strFile, True, wks.Name & "$"
For the most part, all of the values are being imported correctly. However, when there is a column where the top several rows do not have any cents, it seems that when it will not bring in the cents in the subsequent records. It will bring in the rounded number instead. I am not 100% sure, but I think there is something in Access where it looks at the top rows to determine the datatype it is importing. In this case, it seems that it thinks everything will be whole dollars and it ignores the cents.
I know that if someone manually formats the sheet to show 2 decimal places prior to importing, it will work fine. But, I am trying to eliminate the need for any modification to the original dataset. What is the best approach at doing this?