SQL headache - no longer a headache :-)

SQL headache - no longer a headache :-)

Post by Krij » Tue, 27 Jun 2006 16:08:59


Hi!

I solved the problem anyway with the help I received. :-)

Skreving? A new english word or...??????

Lyle Fairfield skrev:
 
 
 

SQL headache - no longer a headache :-)

Post by Krij » Tue, 27 Jun 2006 21:36:21

Hi!

The problem with this SQL statement is that it doesn't 'know' which
record to put into.

Therefore:

strPutBack = "INSERT INTO
tblAmountItems(ItemID,Amount,MyDate,Returned) " _
& "SELECT ItemID,Amount,MyDate,Returned " _
& "FROM tblOrderdetails " _
& "WHERE tblOrderdetails.Returned = True
AND tblOrderdetails.ItemID = Forms!frmOrders!frmOrderdetails!ItemID
AND tblOrderdetails.OrderID = Forms!frmOrders!OrderID;"

CurrentDb.Execute strPutBack, dbFailOnError

Now as the ItemID has been identified, it'll work OK :-)

Me.Name

Krij skrev: