Hi all,
I have a form with a subform. On the subform I change the details in one field in a record and then want vba to change that field in other records where certain other criteria are the same (from other fields). I have managed all of this but then the loop doesn't stop. I have looked everywhere I usually look for a solution but have had no luck, any help would be appreciated.
Here is the code I have:
I have a form with a subform. On the subform I change the details in one field in a record and then want vba to change that field in other records where certain other criteria are the same (from other fields). I have managed all of this but then the loop doesn't stop. I have looked everywhere I usually look for a solution but have had no luck, any help would be appreciated.
Here is the code I have:
Code:
Sqlstr2 = "[class]='" & Me.Class & "'"
Set rst = Me.Recordset
If rst.NoMatch Then
MsgBox "Record not found."
Else
Do While Not rst.EOF
rst.FindNext Sqlstr2
rst.Edit
[LSA] = TempVars!VarTA 'tempvars is set earlier in the code block to me.LSA - this works!
rst.Update
Loop
End If