下面的代碼工作正常,但它並沒有將存儲的值舍入到最近的便士,例如8.025會出現而不是8.01任何人都可以提出修復建議嗎?舍入訪問
Public Function Fs_Update_AccInvoices_Nexum() As Boolean
Dim adoRsInvoiceDCID As New ADODB.Recordset
Dim adoRsNexumInvoices As New ADODB.Recordset
On Error Resume Next
adoRsInvoiceDCID.Open "SELECT * FROM [tInvoiceDCID] where Issued=0" _
, CurrentProject.Connection, 2, 2
While Not adoRsInvoiceDCID.EOF
adoRsNexumInvoices.Open "SELECT * FROM [tPrintInvoiceNumbersNexum] " _
& " WHERE InvoiceID=" & adoRsInvoiceDCID("InvoiceID") _
, CurrentProject.Connection, 2, 2
If Not adoRsNexumInvoices.EOF Then
DoCmd.SetWarnings off
DoCmd.RunSQL "Update [Acc Invoices t Nexum] " _
& " SET [Total Due] = Round((Fees/0.8)+(VAT/0.8)+OutLays,2)" _
& " Fees = Round(Fees/0.8,2), VAT = Round(Vat/0.8,2)" _
& " WHERE Invoice=" & adoRsNexumInvoices("PrintingasINVOICE")
End If
adoRsNexumInvoices.Close
adoRsInvoiceDCID.MoveNext
Wend
adoRsInvoiceDCID.Close
End Function
乾杯 羅斯
感謝隊友最有幫助 – Ross 2012-07-24 12:46:58
當我把「#.00」我得到一個代碼錯誤輪((費用/0.8)+(VAL/0.8)+ OutLays,「#.00」)是這個應該是它的地方? – Ross 2012-07-24 14:15:05
#.00帶格式,不輪。格式((費用/ 0.8)+(VAT/0.8)+ OutLays,「#.00」)' – Fionnuala 2012-07-24 14:16:03