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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

saving the result of a text box to a table

Status
Not open for further replies.

trilock79

Programmer
Jul 16, 2003
2
US
Hi i am fairly new to the working of MS Access.
I have been asked to modify an existing db with some forms and tables already set up.
There is a textbox that uses the input from two drop down list within the same form to determine the value to be dispalyed.
the control source property of the textbox uses the Dlookup function and the inputs form the two lists to search a table to get the coressponding value (basically its looking in a matrix).
what i want to do is to have the result written/saved/?? to the table that the form uses such that i can use this value in a later expression/calculation/....
Can this be done and How??
 
Hi

It can be done

Make an SQL UPDATE statement, and execute it

roughly

Dim strSQL as String
strSQL = "UPDATE MyTable SET MyColumn = " & MyCAlculatedTExtBox & " WHERE MyKey = " & MyKey

DoCmd.RunSQL strSQL

you need to use your own tabel name and Column names in place of the My.., and you need to replace MyKey with the column name(s) which uniquely identify the row to be updated, ie the prime key

See help for DoCmd.RunSQL, docmd.SetWarnings, UPDATE



Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top