Re: How do you compare bookmarks in DAO recordsets?



I didn't quite understand Albert's suggestion of modifying the Findfirst
conditions, but Van Dinh's last post made it clear how I could avoid
comparing bookmarks and compare primary key fields instead. This method works
fine!

I'm still at a loss as to why the bookmark comparison is unreliable, but I'm
a practical guy - I now have a solution and I can stop worrying about
bookmarks.

Thanks to everyone for all the assistance.


"Marshall Barton" wrote:

> Interesting?? I hadn't stumbled over that KB article
> before.
>
> Have you been able to identify any unusual circumstances
> related to the problem? Did stepping through the code
> provide any clues?
>
> Maybe you can avoid the problem using Albert's idea by
> comparing the PK fields of the two recordsets.
> --
> Marsh
> MVP [MS Access]
>
>
> David Anderson wrote:
> >I posted my problem on another Access forum and got a response providing a
> >link to this MS Knowledgebase article:
> >
> >http://support.microsoft.com/default.aspx?scid=kb;en-us;198648
> >
> >The article acknowledges a Type Mismatch problem when comparing bookmarks.
> >The resolution is to do a binary comparison using the StrComp function.
> >Sadly, however, while this is a more elegant solution than my own workaround
> >it does not make my code any more reliable. It still fails in just the same
> >way as before.
> >
> >By the way, my problem is not random. Every time I go through the same set
> >of actions with my form it's always at the same place that it first tells me
> >(wrongly) that the form is already at the selected record.
> >
> >
> >"Marshall Barton" wrote:
> >> I think the only way you can get that error is if one of the
> >> bookmarks is Null. I'm not sure how that can happen, maybe
> >> an empty reordset??
> >>
> >> I suggest that you place breakpoints in the procedure and
> >> step through the code to see where each value is
> >> set/changed/cleared.
> >>
> >>
> >> David Anderson wrote:
> >> >Marshall, my real code is almost identical to your suggestion, with the
> >> >exception that I save the bookmarks to string variables before comparing
> >> >them. Doing the comparison directly, as in "If .Bookmark = Me.Bookmark Then",
> >> >gives a Type Mismatch error. Bookmarks appear to be rather strange things
> >> >......
>
>
.



Relevant Pages

  • Re: How do you compare bookmarks in DAO recordsets?
    ... >The article acknowledges a Type Mismatch problem when comparing bookmarks. ... >>>gives a Type Mismatch error. ...
    (microsoft.public.access.formscoding)
  • Re: "Hustle"
    ... in article 3dellis-664015.07061131032006@xxxxxxxxxxxxxxxxx, Richard Ellis at ... Just be sure to catch the late night ones, and avoid the earlier episodes - ... I'm watching both shows - and comparing them isn't really fair, ...
    (rec.arts.tv)
  • DBD::Oracle question?
    ... comparing to mysql performance. ... Can any body advice me what to do to avoid this ...
    (perl.dbi.users)
  • Re: Solution for Floating-Point Errors
    ... David Mark said the following on 7/23/2007 5:28 PM: ... can I avoid this by a better method than comparing 2 number length ... Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/ ...
    (comp.lang.javascript)
  • Re: Properties of system fonts
    ... FWIW, you should be able to avoid this one from going wrong as good as ... possible with comparing all characters instead of just 1. ...
    (comp.os.os2.programmer.misc)