So I have a string called idstring which contains numbers (Auto ID numbers) in the format: 5 6 7 8 9 10 .... I put this string into an array using the split function. I then want to use this array to find each row with that specific ID and change a field in that row. My code currently is incomplete as im not sure how to goto that ID number
The error i get is: error 91: object variable or with block variable not set
Is this the best method or is there some other cmd that i dont know about?
Code:
set dbs = currentdb
dim rst as recordset
set rst = dbs.openrecordset ("table1")
idarray=Split(idstring) 'idstring is previously defined earlier in the code
rst.movefirst
For x = LBound(idarray)) To UBound(idarray)
rst.findfirst [ID] = idarray(x) 'This is where im getting the error
rst.edit
rst("field 1") = "sometext"
Next x
The error i get is: error 91: object variable or with block variable not set
Is this the best method or is there some other cmd that i dont know about?