Access VBADiscuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
I have a report in which i calculate a running sum. I want to be able to copy that into a Table. The Report will only result in one line always. I have a "Temp" Global Variable setup which saves it.
On a form i can just use Tcost.value = temp and it updates it, but it does not work in the form. Since i save it in a global variable i can use it anywhere.
What would be the best way to insert that into the table? I am thinking maybe and SQL statment?
strsql = "Update assemblies set tcost = temp Where Parentid = myvalue"
CurrentDb.Execute strsql, dbFailOnError
where assemblies is my table and tcost is the field in the table and temp is a global variable i want to assign tcost to and parentid is a field in the table and myvalue is another varible which i am comparing parentid to. instead of my value i could use rst.Fields("Parentid").Value to get the right answer
I get an error when trying to run it
"Run-time error '3061':
To few paramters. expected 2.
Hope u can help i'm guessing i'm just using wrong syntax