V
Vensia
Dear all,
I put the following code at After_Update event of frmInvoiceDetail
Dim rs As DAO.Recordset
Dim strSQL As String
Dim curTotalAmount As Currency
strSQL = "SELECT * FROM tblInvoiceMain WHERE InvoiceNo = '" &
Me!InvoiceNo & "'"
curTotalAmount = Nz(DSum("Amount", "tblInvoiceDetail", "InvoiceNo = '" &
Me!InvoiceNo & "'"), 0)
Set rs = CurrentDb.OpenRecordset(strSQL)
With rs
.Edit
!TotalAmount = curTotalAmount
!Tax = !TotalAmount * 0.1
.Update
End With
rs.Close
Set rs = Nothing
Every time after I insert a new line of item, the Detail Form
(frmInvoiceDetail) will scroll and at the screen, I just can see the new
record. I should use the vertical scroll to see the existing lines of item
Why this happens ?
Thanks.
Vensia
I put the following code at After_Update event of frmInvoiceDetail
Dim rs As DAO.Recordset
Dim strSQL As String
Dim curTotalAmount As Currency
strSQL = "SELECT * FROM tblInvoiceMain WHERE InvoiceNo = '" &
Me!InvoiceNo & "'"
curTotalAmount = Nz(DSum("Amount", "tblInvoiceDetail", "InvoiceNo = '" &
Me!InvoiceNo & "'"), 0)
Set rs = CurrentDb.OpenRecordset(strSQL)
With rs
.Edit
!TotalAmount = curTotalAmount
!Tax = !TotalAmount * 0.1
.Update
End With
rs.Close
Set rs = Nothing
Every time after I insert a new line of item, the Detail Form
(frmInvoiceDetail) will scroll and at the screen, I just can see the new
record. I should use the vertical scroll to see the existing lines of item
Why this happens ?
Thanks.
Vensia