Hello,
I've a Form with some Data, that I want to use to change the records of a table.
I mean I want the user to be able to input some data in a Form, eg. Subject, Year, City. I want to compare this data with some data in a table, and change the value of a field of each record.
I know how to do it, using an Auxiliary Form, I use >
----------
Do While Not IsNull(IdEmpleado) And Not Forms!Teachers!IdEmpleado Like "*(Autonumber)*"
............. I compare one by one and change...
DoCmd.GoToRecord , , acNext
Loop
------------- This code WORKS perfectly, but I want to use a faster method, but It doesn't work>
So I tried the following method :
Set db = CurrentDb()
Set rst = db.OpenRecordset("Teachersform")
Do While Not rst.EOF
'........ Here I compare the fields and change the one I want
rst.MoveNext
Loop
rst.Close
And now It doesn't work, the following error appears:
Update or CancelUpdate without AddNew or Edit
What should I do???
Thanks!!!