This is probably a really easy one for you all but I recently had my macro/VBA code stop working. I am exporting one record containing 16 fields. I was using Access 2003 originally and it had the built in macro transferspreadsheet. Now 2007 doesn't have that option so I am using VBA code to run transferspreadsheet. I am doing this in 2 other databases and they work just fine. The only thing I can think of that has changed is the data types were changed from float to decimal in my sql database that access pulls from. Also, another sql username/password had been added so some other users could access the database.
The error that comes up is "division by zero" which is odd since there aren't any calculations being done besides counts.
Any help would be greatly appreciated. Thanks
My code is:
' VSExport_to_Excel
'
'------------------------------------------------------------
Function VSExport_to_Excel()
On Error GoTo VSExport_to_Excel_Err
DoCmd.TransferSpreadsheet acExport, 10, "zach", "C:\Documents and Settings\jheiling\Desktop\Zach Drawings\M11VisionGraph.xls", False, ""
VSExport_to_Excel_Exit:
Exit Function
VSExport_to_Excel_Err:
MsgBox Error$
Resume VSExport_to_Excel_Exit
End Function
The error that comes up is "division by zero" which is odd since there aren't any calculations being done besides counts.
Any help would be greatly appreciated. Thanks
My code is:
' VSExport_to_Excel
'
'------------------------------------------------------------
Function VSExport_to_Excel()
On Error GoTo VSExport_to_Excel_Err
DoCmd.TransferSpreadsheet acExport, 10, "zach", "C:\Documents and Settings\jheiling\Desktop\Zach Drawings\M11VisionGraph.xls", False, ""
VSExport_to_Excel_Exit:
Exit Function
VSExport_to_Excel_Err:
MsgBox Error$
Resume VSExport_to_Excel_Exit
End Function