PC Review


Reply
 
 
=?Utf-8?B?SmFjIFRyZW1ibGF5?=
Guest
Posts: n/a
 
      16th Mar 2006
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
 
Reply With Quote
 
 
 
 
Alex Dybenko
Guest
Posts: n/a
 
      16th Mar 2006
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


 
Reply With Quote
 
=?Utf-8?B?SmFjIFRyZW1ibGF5?=
Guest
Posts: n/a
 
      16th Mar 2006
Hi Alex,
That is the answer. It works fine now.
That gave me a chance to check the help file on the RecordsetClone and
Bookmark items.
Thank you very much and have a good day.
--
Jac Tremblay


"Alex Dybenko" wrote:

> 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

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search for record and goto record singing4phun Microsoft Access 8 16th Jan 2009 02:16 AM
RE: GoTo Record =?Utf-8?B?QmFycnkgR2lsYmVydA==?= Microsoft Access VBA Modules 0 13th Sep 2006 11:15 PM
GoTo Last record ? =?Utf-8?B?b294eA==?= Microsoft Access Macros 1 14th Jul 2005 05:55 AM
calendar goto record or add new record tommy t via AccessMonster.com Microsoft Access Form Coding 0 28th Apr 2005 03:38 PM
Goto an existing record based on the values in the new record Hallgeir Microsoft Access Form Coding 0 25th Jan 2005 03:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:09 PM.