Article ID: 191883
Article Last Modified on 1/23/2007
Sub main()
On Error GoTo ErrorHandler
Dim db As DAO.Database, SQL As String
Dim td As DAO.TableDef, fld As DAO.Field, qd As DAO.QueryDef
Dim rs As DAO.Recordset
Dim bkmk As Variant
Dim nAbsolutePosition As Variant
' Open database with large table.
Set db = DBEngine.OpenDatabase("C:\Northwind.mdb")
Set db = CurrentDb()
' Open a dynaset or snapshot with hundreds of records.
Set rs = _
db.OpenRecordset("SELECT * FROM [Order Details]", _
dbOpenDynaset)
' Populate the table.
rs.Move (1000)
bkmk = rs.Bookmark
' Delete a record.
rs.MoveFirst
rs.Delete
' Go to a bookmark way down the table.
rs.Bookmark = bkmk
' Get the position so you can move back here.
nAbsolutePosition = rs.AbsolutePosition
Debug.Print "Absolute position = " & nAbsolutePosition _
& ": UnitPrice = " & rs![UnitPrice]
' Move to position by moves.
rs.MoveFirst
rs.Move (nAbsolutePosition)
Debug.Print nAbsolutePosition & " moves: UnitPrice = " _
& rs![UnitPrice]
Exit Sub
ErrorHandler:
MsgBox "An error has occurred "
Resume Next
End Sub151261 OFF97: How to Obtain and Install MS Office 97 SR-2
Me.Requery
at the beginning of the AfterUpdate event of the combo box as follows
Sub ComboBoxName_AfterUpdate()
' Add this line to requery the form.
Me.Requery
' The remaining code was generated by the wizard.
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[Key] = " & Me!ComboBoxName
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
Now when you edit data in the found record it will save properly.193052 ACC: Find Bookmark Wizard Available in Download Center
172733 ACC97: Updated Version of Microsoft Jet 3.5 Available for Download
100132 ACC: Four Ways to Move to a Record from a Combo Box Selection
Additional query words: pra corruption integrity
Keywords: kbbug kbpending KB191883