Setting value of record in table

davesmith202

Employee of Access World
Local time
Today, 10:50
Joined
Jul 20, 2001
Messages
522
I want to set the value of the field "Cost" in "tblMyTable" for the record whose primary key is stored in strPrimary.

What code would I need to update the table value to strCostValue?

Thanks,

Dave
 
May need just a little more info.

Maybe:
Dim strSQl as String

strSQl = "UPDATE tblMyTable.Cost ='" & strCostValue & "' WHERE tblMyTable.PrimaryKey ='" & strPrimary & "';"

docmd.runsql strSQl

Is field cost currency?
Is the Primary key a string?

If so, use Ccur(strCostValue) might be required.
 
Great, that was all I needed. Thank you!
 

Users who are viewing this thread

Back
Top Bottom