W
Wahab
Good Day
I have a continuous bound form to table ‘tSalesDetails’, normally there will
be 7 to 10 records for every Invoice. This form is working fine, adding
records to bound table. But for some reports I use to re-enter those sales in
another table (tSalesReports), this is duplicate job and I want to avoid this
by writing code I tried with the following but not adding to that table pls
check my code
Set rst = CurrentDb.OpenRecordset("SELECT * FROM tSalesReports WHERE
InvoiceNo = " & InvoiceNo & "")
Do Until rst.EOF
If Not rst.EOF Then
rst.Edit
Else
rst.AddNew
End If
rst!InvoiceNo = InvoiceNo
rst!ProductCode=ProductID
rst!Cartons = Quantity
rst!ItemPrice = Price
rst!Sale = ProductSales
rst.Update
rst.MoveNext
Loop
rst.Close
Pls help me
thanks and regards
wahab
I have a continuous bound form to table ‘tSalesDetails’, normally there will
be 7 to 10 records for every Invoice. This form is working fine, adding
records to bound table. But for some reports I use to re-enter those sales in
another table (tSalesReports), this is duplicate job and I want to avoid this
by writing code I tried with the following but not adding to that table pls
check my code
Set rst = CurrentDb.OpenRecordset("SELECT * FROM tSalesReports WHERE
InvoiceNo = " & InvoiceNo & "")
Do Until rst.EOF
If Not rst.EOF Then
rst.Edit
Else
rst.AddNew
End If
rst!InvoiceNo = InvoiceNo
rst!ProductCode=ProductID
rst!Cartons = Quantity
rst!ItemPrice = Price
rst!Sale = ProductSales
rst.Update
rst.MoveNext
Loop
rst.Close
Pls help me
thanks and regards
wahab