Hey, I'm stuck (again)
So, I want to look up a record in my table "youngperson" using the current value of a combobox and then update the "Outcome" field with some text. This is what I'm trying:
Any ideas would, as always, be greatly appreciated!
Thanks for readin'
Shurgs
Edit: I just changed the code to this and I think I'm on the right tracks now. I'll tell ya if it goes wrong.
So, I want to look up a record in my table "youngperson" using the current value of a combobox and then update the "Outcome" field with some text. This is what I'm trying:
Code:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim i As Integer
Set db = CurrentDb
Set rs = db.OpenRecordset("youngperson")
rs.Edit
rs.MoveFirst
For i = 1 To rs.RecordCount
If (rs("ypid") = Me![com_yp]) Then
rs("Outcome") = comOutcomes.Text
lblOutcome.Caption = rs("Outcome")
rs.Update
Else
rs.MoveNext
End If
Next
rs.Close
Any ideas would, as always, be greatly appreciated!
Thanks for readin'
Shurgs
Edit: I just changed the code to this and I think I'm on the right tracks now. I'll tell ya if it goes wrong.
Last edited: