Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report VBA quit working

Status
Not open for further replies.

pduncan

IS-IT--Management
Jun 20, 2003
203
US
Please help! I have a report that has some code behind it that updates a table when the report is colsed - it worked great until the other day.. now it doesnt update - can someone please give me a clue

here is a code sample..
Code:
Private Sub Report_Close()

'save total amount
    Dim InvTotal
    InvTotal = Me.Text94
    Dim Invoice
    Invoice = Me.InvoiceNo
    Dim TaxTotal
    TaxTotal = Me.Text103
    
    Dim strsSQL As String
    
    strsSQL = "UPDATE tblInvoiceTotals SET TotalInv = """ & InvTotal & """ Where tblInvoiceTotals.InvoiceNo = """ & Invoice & """;"
        DoCmd.RunSQL strsSQL
    
    strsSQL = "UPDATE tblInvoiceTotals SET NationalTax = """ & TaxTotal & """ Where tblInvoiceTotals.InvoiceNo = """ & Invoice & """;"
        DoCmd.RunSQL strsSQL
        
    strsSQL = "UPDATE tblInvoiceTotals SET tblInvoiceTotals.DeltaTax = [tblInvoiceTotals]![RegionalTax]-[tblInvoiceTotals]![NationalTax] WHERE tblInvoiceTotals.InvoiceNo = """ & Invoice & """;"
        DoCmd.RunSQL strsSQL
        
    strsSQL = "UPDATE tblInvoiceTotals SET tblInvoiceTotals.DeltaTotal = [tblInvoiceTotals]![RegionalTotalInv]-[tblInvoiceTotals]![TotalInv] WHERE tblInvoiceTotals.InvoiceNo = """ & Invoice & """;"
        DoCmd.RunSQL strsSQL

End Sub

Thanks, PDUNCAN
Memphis, TN - USA
When I die, I want to die like my grandfather-- who died peacefully in
his sleep. Not screaming like all the passengers in his car.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top