Please write the pseudo code. Right now your code says:
The value of the sField variable equals the value in Me.txtLoc, and something else not specified.
Add a new record to the rsOver recordset,
rsOver recordset field Overflow1 is equal to some value in the rsReserve recordset called sField, but Not the variable sField.
Update the rsOver recordset.
You can use a variable to indicate some field name in a recordset. It appears you have TWO recordsets open at the same time, one called rsOver, and one called rsReserve. You want to pick a field from rsReserve, and add its value to rsOver. But you want that selection to be based on what is typed in the text box txtLoc. If that is the case, then you can do this:
sField = Me.txtLoc
'If there is a field name typed in txtLoc on the form, then it will be taken here.
Then:
rsOver.AddNew
rsOver("Overflow1") = rsReserve(sField)
rsOver.Update
Did that work?
mmcdonal
|