CreatProperty

Terri Hdokins

Registered User.
Local time
Today, 00:19
Joined
Jun 21, 2001
Messages
15
The following code delete's a table and create's a new one. I would like to be able to bring some of the currency fields in with more than 2 decimal places. Does anyone have any suggestions?
Thanks,
Terri Hodkins

Private Sub cmdGrowerSalesAudit_Click()


On Error GoTo cmdGrowerSalesAudit_Err


Dim strSQL As String
'*****************************************************
'DoCmd.Hourglass True
DoCmd.Echo True, ""
DoCmd.DeleteObject acTable, "tblSalesAudit"

strSQL = "CREATE TABLE tblSalesAudit (ID Autoincrement, Invoice LONG,Tag TEXT(10), StockId TEXT(15),PoWk TEXT(10), Qty LONG,ActualUnit CURRENCY,ActualGrossSales CURRENCY,AP TEXT(5),AdjCode TEXT(5),CntCode TEXT(5),PoolUnit CURRENCY,PoolGrossSales CURRENCY,FeeUnit CURRENCY,SalesFeeTotal CURRENCY,DueToGrower CURRENCY);"

DoCmd.RunSQL strSQL
'*****************************************************
DoCmd.TransferSpreadsheet acImport, 8, "tblSalesAudit", "U:\Datafile\Fresh Kist Produce\FLOOR PRICING\MASTER POOL WEEK.xls", _
True, "tblSalesAudit!A1:O19999"
'DoCmd.Hourglass False
msgbox "***** IMPORT OF SALES AUDIT IS COMPLETE *****", vbInformation, ""
Exit Sub

cmdGrowerSalesAudit_Exit:
Exit Sub

cmdGrowerSalesAudit_Err:
msgbox Error$
Resume cmdGrowerSalesAudit_Exit

End Sub
 
Why recreate the same table? Why not simply delete the contents of the old and import the new data to an empty table with it's original structure intact? Of course you would have to set the format property of the currency field.



[This message has been edited by David Mack (edited 08-01-2001).]
 

Users who are viewing this thread

Back
Top Bottom