Hi,
yes, you have to same the value of selected record ID in some variable, then
you can select this record back - first remove filter, then:
me.recordsetclone.findfirst "[NO_DOSS_IR] = " & lngSavedID
if not me.recordsetclone.nomatch then
me.bookmark=me.recordsetclone.bookmark
end if
--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
"Jac Tremblay" <(E-Mail Removed)> wrote in message
news:4530D9FC-0743-4D8A-8248-(E-Mail Removed)...
> Hi,
> I have a form that displays data from different records. I added a buttton
> to remove the filter when I do not want it anymore. The simple code is:
> strFiltre = "([NO_DOSS_IR] = ""*"")"
> DoCmd.ApplyFilter FilterName:=strFiltre
> When this code executes, the first record is displayed.
> I would like to redisplay the record that was displayed when the button
> was
> clicked.
> Is that possible?
> I thought I could take note of the value of the primary key (NO_DOSS_IR)
> and
> then use the DoCmd.GoToRecord but I can't find the right syntax.
> Do I need to create a Recordset and use a bookmark? If yes, then how do I
> get to display the right record without filtering the data?
> Thanks.
> --
> Jac Tremblay