i've got this simple sub that updates a field is a set of records to be a clean sequence of numbers; but I've got "something" wrong. All of the cycling thru number and updatinng of variable values foot correctly, it's the ".update" and ".edit" parts that aren't working (possibly the ".findfirst" also ?)
any suggestionns would be a great help
many thanks in advance, mark
-------------------------------------
Set Db = CurrentDb()
Set rst = Db.OpenRecordset("SELECT tbeAdditionalPages.Printorder, tbeAdditionalPages.BaseCatalogSheet " & _
"FROM tbeAdditionalPages " & _
"WHERE tbeAdditionalPages.type = '" & Forms![frmSpec].[Type] & "';")
With rst
vCnt = DCount("[Type]", "tbeAdditionalPages", "[Type] = '" & Forms![frmSpec].Type & "'")
vCntLoop = 1
vCntPrintOrder = vCnt
Do While vCntLoop <= vCnt
Dim strSearch As String
strSearch = DMax("[PrintOrder]", "tbeAdditionalPages", "[Type] = '" & Forms![frmSpec].Type & "'")
.FindFirst strSearch
.edit
![Printorder] = vCntPrintOrder
vCntPrintOrder = vCntPrintOrder - 1
.Update
vCntLoop = vCntLoop + 1
MsgBox vCntLoop & " - " & vCntPrintOrder
Loop
End With