Hi all,
trying to run this code that should insert '1' into the first record then adds a value to that and then inserts that to the next record (value 2) and inserts that into the next field until it comes to the end of the recordset of the query but I am getting this error message:- Too few parameters, expected 1.
Dim db As Database
Dim rs As Recordset
Dim intPosition As Integer
Set db = CurrentDb
Set rs = db.OpenRecordset("qryMyQuery")
intPosition = 0
rs.MoveFirst
Do While Not rs.EOF
rs.Edit
rs!Rating = intPosition + 1
rs.Update
rs.MoveNext
Loop
rs.Close
I thought it should be pretty straight forwards but I have messed up somewhere. Can anyone see wheer I went wrong ?
Thanks in advance,
Mitch.....
trying to run this code that should insert '1' into the first record then adds a value to that and then inserts that to the next record (value 2) and inserts that into the next field until it comes to the end of the recordset of the query but I am getting this error message:- Too few parameters, expected 1.
Dim db As Database
Dim rs As Recordset
Dim intPosition As Integer
Set db = CurrentDb
Set rs = db.OpenRecordset("qryMyQuery")
intPosition = 0
rs.MoveFirst
Do While Not rs.EOF
rs.Edit
rs!Rating = intPosition + 1
rs.Update
rs.MoveNext
Loop
rs.Close
I thought it should be pretty straight forwards but I have messed up somewhere. Can anyone see wheer I went wrong ?
Thanks in advance,
Mitch.....