Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

updating a value on a table from a field 2... 1

Status
Not open for further replies.

wshs

Programmer
Nov 22, 2005
220
US
similar question as the first but..

CurrentProject.Connection.Execute _
"Update tbl_psc " & "SET contractamt = contractamt + " & Me.txtContAmt & " WHERE contractno='" & Me.txtContNum & "' AND Addconno=" & Me.txtAddContNum & "'"

can this not work?
i want access to look up both contractno and addconno to add contract amt since a record can have same contractno but different addconno...
 
Either this:
"Update tbl_psc " & "SET contractamt = contractamt + " & Me.txtContAmt & " WHERE contractno='" & Me.txtContNum & "' AND Addconno=[!]'[/]" & Me.txtAddContNum & "'"
Or this:
"Update tbl_psc " & "SET contractamt = contractamt + " & Me.txtContAmt & " WHERE contractno='" & Me.txtContNum & "' AND Addconno=" & Me.txtAddContNum

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
OOps, sorry for the typo.
Either this:
"Update tbl_psc " & "SET contractamt = contractamt + " & Me.txtContAmt & " WHERE contractno='" & Me.txtContNum & "' AND Addconno=[!]'[/!]" & Me.txtAddContNum & "'"
Or this:
"Update tbl_psc " & "SET contractamt = contractamt + " & Me.txtContAmt & " WHERE contractno='" & Me.txtContNum & "' AND Addconno=" & Me.txtAddContNum

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
this one

"Update tbl_psc " & "SET contractamt = contractamt + " & Me.txtContAmt & " WHERE contractno='" & Me.txtContNum & "' AND Addconno=" & Me.txtAddContNum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top