How can I determine my Current Record?

  • Thread starter Thread starter michaaal
  • Start date Start date
M

michaaal

I am going to do an SQL type query on my database based on the Current
Record that is selected.
How can I determine which is the Current Record?

Something like this...?

x = Application.CurrentRecordID
 
Assuming that you want to save a reference to the Current Record so you can come back to it later, use the Bookmark property of the Recordset. Code might be something like the following:

Dim vCurRecBookmark as Variant
Dim rsData as DAO.Recordset
'
' Populate rsData using a SQL Query somehow
'
vCurRecBookMark = rsData.Bookmark ' Save Pointer to Current record
'
' Do something that moves current in rsData to another record
'
rsData.Bookmark = vCurRecBookmark ' Resets current to bookmarked record
'
' Note: rsData must be Bookmarkable for this to work.
'

Hope this helps.

Victor
 
Back
Top