zs.MoveLast: zs.MoveFirst
rc = zs.RecordCount
If nz(Me.subfrm02.Form.cbxViewRecByPage, "500") = "(Все)" Then
zs.PageSize = 1000000
Else
zs.PageSize = nz(Me.subfrm02.Form.cbxViewRecByPage, 500) '-- 500 поумолчанию
End If
zs.AbsolutePage = nz(Me.subfrm02.Form.txtPage, 1)
Me.subfrm02.Form.txtPages = zs.PageCount
Me.subfrm02.Form.txtPageInfo = "всего строк " & rc
SetStatus "Загружаем " & IIf(zs.PageSize < rc, zs.PageSize, rc) & " строк [страница " & zs.AbsolutePage & _
" из " & zs.PageCount & "]": DoEvents
Set ps = CopyRecordsetStructure(zs) 'zs.GetRows(zs.PageSize, zs.AbsolutePage)
ps.CursorLocation = adUseClient
ps.Open , , adOpenKeyset, adLockOptimistic
i = 1
Do While i <= zs.PageSize And Not zs.EOF
ps.AddNew
For j = 0 To zs.Fields.Count - 1
ps.Fields(j).Value = zs.Fields(j).Value
Next j
ps.Update
i = i + 1
zs.MoveNext
Loop
|