Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DAP - Filter by Selection 1

Status
Not open for further replies.

FancyPrairie

Programmer
Oct 16, 2001
2,917
US
After I select the Filter By Selection button, my data access page filters the data correctly. However, if I try to find a record, the first record it finds does not exist in the filtered recordset.

Here's the command I user to find the record:

Set rst = MSODSC.DataPages(0).Recordset
rst.Find "strLastName Like 'S*'",0,1,1

It finds the first name that starts with "S", but the name it finds does not exist in the filtered data. Note that MSODSC.DataPages(0).Filter contains the correct information and MSODSC.DataPages(0).IsFilterOn = True.

What am I doing wrong?
 
fneily,

I had looked at that web site previously and don't think it does what I want. I do have a find button on my page. The problem is that even though the page is filtered, the find command will find records that are not part of the filtered set. For example, suppose the following records represent the unfiltered recordset

Aname
Bname
Sname1
Sname2

And, assume, that the following records represent the filtered recordset.

Bname
Sname2

The first record the find command finds is "Sname1" which is part of the unfiltered recordset but not the currently filtered recordset. I would have suspected that the find command would have found Sname2 since Sname1 is not part of the filtered set.

Am I using the wrong recordset? I don't get it!!
 
I set up a table with your names and next to them place an Amount field. So the corresponding records had the values of
Aname 50
Bname 10
Sname1 30
Sname2 10

I have a command button that when clicked the onchange event looked like:

Dim rst
Set rst = MSODSC.DataPages(0).Recordset.Clone
rst.Find "TestName Like 'S*'",0,1,1
MSODSC.DataPages(0).Recordset.Bookmark = rst.Bookmark

First I filtered on 10, which gave two records. Then I clicked the button and it found Sname2.

 
Odd...

Thanks for taking the time to set it up and test it. I will give it another shot Monday. (I know my example didn't specify the clone, but I did try it with it.)

I wonder if it has something to do with the fact that I've created a group on the page. Oh well, I'll look at it Monday.

A star for effort
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top