It's Working But...

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

In an SQL statement can you do this?
"UPDATE tblGiftCard SET (tblGiftCard.GiftAmount +
Forms!FrmCheckPaymnt!TxtAmount) " & _
"WHERE tblGiftCardID = Forms!frmCheckPaymnt!ID;"

Basically I want to know if I can add a table amount and an amount on a
form.

Thanks
DS
 
DS said:
In an SQL statement can you do this?
"UPDATE tblGiftCard SET (tblGiftCard.GiftAmount +
Forms!FrmCheckPaymnt!TxtAmount) " & _
"WHERE tblGiftCardID = Forms!frmCheckPaymnt!ID;"

Basically I want to know if I can add a table amount and an amount on
a form.

Your syntax isn't quite right, but if your purpose is to add the amount
from the form to the current amount in the GiftAmount field in the
specified record, you should be able to do it with an update query like
this:

UPDATE tblGiftCard
SET GiftAmount =
Nz(GiftAmount, 0) + [Forms]![FrmCheckPaymnt]![TxtAmount]
WHERE tblGiftCardID = [Forms]![frmCheckPaymnt]![ID]
 
Most Perfect!
Thank you, Dirk
DS
Dirk Goldgar said:
DS said:
In an SQL statement can you do this?
"UPDATE tblGiftCard SET (tblGiftCard.GiftAmount +
Forms!FrmCheckPaymnt!TxtAmount) " & _
"WHERE tblGiftCardID = Forms!frmCheckPaymnt!ID;"

Basically I want to know if I can add a table amount and an amount on
a form.

Your syntax isn't quite right, but if your purpose is to add the amount
from the form to the current amount in the GiftAmount field in the
specified record, you should be able to do it with an update query like
this:

UPDATE tblGiftCard
SET GiftAmount =
Nz(GiftAmount, 0) + [Forms]![FrmCheckPaymnt]![TxtAmount]
WHERE tblGiftCardID = [Forms]![frmCheckPaymnt]![ID]

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top