Hi!
I've found the problem in my database (ms access 2000). The ting is
that returning two or more orderlines requieres that both item has the
same ItemID. When returning two different itemID, the first one only
will be returned. I can see the logic, I believe.
Her is the code:
A button on frmOrders will let user return an order.
strPutBack = "INSERT INTO tblAmountItems( Amount,MyDate,R eturned) " _
& "SELECT Amount,MyDate,R eturned " _
& "FROM tblOrderdetails " _
& "WHERE tblOrderdetails .Returned = True
AND tblOrderdetails .ItemID = " &
Forms!frmOrders !frmOrderdetail s!ItemID
AND tblOrderdetails .OrderID = " & Forms!frmOrders !OrderID;"
CurrentDb.Execu te strPutBack, dbFailOnError
Now my question is:
Could I use a For ... Each here in order to have the code insert each
ItemID to the tblAmountItems? Or is there any other way to make the
code repeat itself and not stop before
all ItemID are returned?
Should I use a recordset object here?
Questions....qu estion....AAAaa aaaaaaaaaaaa... ............... ..
Thank you :-)
Me.Name
I've found the problem in my database (ms access 2000). The ting is
that returning two or more orderlines requieres that both item has the
same ItemID. When returning two different itemID, the first one only
will be returned. I can see the logic, I believe.
Her is the code:
A button on frmOrders will let user return an order.
strPutBack = "INSERT INTO tblAmountItems( Amount,MyDate,R eturned) " _
& "SELECT Amount,MyDate,R eturned " _
& "FROM tblOrderdetails " _
& "WHERE tblOrderdetails .Returned = True
AND tblOrderdetails .ItemID = " &
Forms!frmOrders !frmOrderdetail s!ItemID
AND tblOrderdetails .OrderID = " & Forms!frmOrders !OrderID;"
CurrentDb.Execu te strPutBack, dbFailOnError
Now my question is:
Could I use a For ... Each here in order to have the code insert each
ItemID to the tblAmountItems? Or is there any other way to make the
code repeat itself and not stop before
all ItemID are returned?
Should I use a recordset object here?
Questions....qu estion....AAAaa aaaaaaaaaaaa... ............... ..
Thank you :-)
Me.Name
Comment