Re: How do you compare bookmarks in DAO recordsets?
- From: Marshall Barton <marshbarton@xxxxxxxxxx>
- Date: Sat, 11 Jun 2005 20:01:20 -0500
David Anderson wrote:
>Thanks for the help, Marshall. I've used the following code to implement your
>suggestion, and it works the first time I find that the form is already where
>I want to be. However, subsequent passes through the code, when a move IS
>required, still indicate (wrongly) that the form is already at the specified
>record. Is there perhaps something about bookmarks that I don't understand?
>
>Dim varBM1 As String
>Dim varBM2 As String
>
>varBM1 = Me.Bookmark
>varBM2 = rstFrames.Bookmark
>
>If Not varBM1 = varBM2 Then
> MsgBox "About to move to selected record"
> Me.Bookmark = rstFrames.Bookmark
>Else
> MsgBox "Subform already at required record"
>End If
As I understand what you're doing, the logic I would use is
something like:
With Me.RecordsetClone
.FindFirst . . .
If Not .NoMatch Then
If .Bookmark = Me.Bookmark Then
MsgBox "Already there"
Else
MsgBox "Moving"
Me.Bookmark = .Bookmark
End If
Else
MsgBox "Not found"
End If
End With
The check for NoMatch seems critical to me. If the search
is unsuccessful, the recordset's bookmark is kind of
unknown.
If none of that helps, then I think I need to see the rest
of your code.
--
Marsh
MVP [MS Access]
.
- Follow-Ups:
- Re: How do you compare bookmarks in DAO recordsets?
- From: David Anderson
- Re: How do you compare bookmarks in DAO recordsets?
- References:
- How do you compare bookmarks in DAO recordsets?
- From: David Anderson
- Re: How do you compare bookmarks in DAO recordsets?
- From: Marshall Barton
- Re: How do you compare bookmarks in DAO recordsets?
- From: David Anderson
- How do you compare bookmarks in DAO recordsets?
- Prev by Date: Re: Orientation Problem With Printer
- Next by Date: Re: Dsum not working with continuous subform
- Previous by thread: Re: How do you compare bookmarks in DAO recordsets?
- Next by thread: Re: How do you compare bookmarks in DAO recordsets?
- Index(es):
Relevant Pages
|