Access does not support Stored Procedures. So if your data tables are in an Access database, then this will not work. If your tables are in a SQL Server database, then this could work.
If you want to reuse this code, you can always put the update in a function in a module, and then call the function from your various events. That would look something like:
Public iField As Integer
Function Updatemytbl(iField As Integer)
Dim rs As ADODB.Recordset
Dim sSQL As String
sSQL = "UPDATE mytbl SET fld1 = " & iField
Set rs = New ADODB.Recordset
rs.Open sSQL, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
End Function
Then when you call it, do this, for example on a button's On Click event:
iField = Me.cboFieldCombo
Updatemytbl(iField)
This would give you some of the function you are looking for in reusable code.
Did that help?
mmcdonal
Look it up at:
http://wrox.books24x7.com