Locating record on a continuous form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using code behing a form, how do I reference a specific record number, say number 6, on a continuous form containing 25 records

Thank

Gary S
 
Gary,
You can access that record by using something like:

*** warning: air code ***
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
rst.FindFirst "IDField="&Something
If Not rst.NoMatch Then
MsgBox rst("asdf")
Else
MsgBox "No match"
End If
Set rst = Nothing
*** end code ***

Hope this helps,
Mattias Jonsson

Gary S said:
Using code behing a form, how do I reference a specific record number, say
number 6, on a continuous form containing 25 records?
 
Thanks Mattias, works very well, congratulations on your 'air code'....

One final point, how do I now move the cursor to that record, and is it accessible as a particular record number on that form

Kind regard

Gary S
 
Gary, Glad that worked (unexpectedly) out of the box. You are right, there
is sort of a record number on the form. Try experimenting with the .SelTop
property. It, together with .SelHeight, allows you to select records. If you
just set .SelTop and leave .SelHeight at 1 then you will move focus around
on your continuous form. Hope that helps with the next step / Mattias

Gary S said:
Thanks Mattias, works very well, congratulations on your 'air code'.....

One final point, how do I now move the cursor to that record, and is it
accessible as a particular record number on that form?
 
Hi,
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
rst.FindFirst "IDField="&Something
If Not rst.NoMatch Then
MsgBox rst("asdf")
Me.Bookmark = rst.Bookmark
Else
MsgBox "No match"
End If
Set rst = Nothing
 
Back
Top