Problem: Excel file sent to me containing golf indices, which come in with max 1 decimal digit (example 15.2). I import file into Access 365 db as a new table with vba code:
If I select the 15.2 in the Excel file, the actual value is 15.19999etc. but it imports as 15.1 and not 15.2. I obviously need it to round up, but it is already truncated after the above code. What am I missing? I know I could round the index value if it imported with all of the decimal digits, but it just truncates without giving me the option.
Code:
Dim vFilePaths As Variant
vFilePaths = fGetFile(e_MultiSelect + e_FileMustExist + e_Explorer, , , , , , _
"Choose file to Import", , 4096)
If Len(vFilePaths) > 0 Then
strImage = CStr(vFilePaths)
End If
DoCmd.TransferSpreadsheet acImport, 10, "GHINIndexList", strImage, True, "A:B" 'first two cols
If I select the 15.2 in the Excel file, the actual value is 15.19999etc. but it imports as 15.1 and not 15.2. I obviously need it to round up, but it is already truncated after the above code. What am I missing? I know I could round the index value if it imported with all of the decimal digits, but it just truncates without giving me the option.
Attachments
Last edited: