|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ADO Recordset Filter ProblemI have a recordset with data that I want to filter. I use the filter method
based my query and it filters the recordset. However, my question is why does it only display one row of data when the query should get multiple records? Thanks George,
You would really need to give the group the filter statement and an explanation of what type of data (with sample values) are being filitered. Alastair MacFarlane Show quoteHide quote "george" wrote: > I have a recordset with data that I want to filter. I use the filter method > based my query and it filters the recordset. However, my question is why > does it only display one row of data when the query should get multiple > records? > > Thanks > > > "Alastair MacFarlane" <AlastairMacFarl***@discussions.microsoft.com> wrote And how you are displaying the resultsin message news:1CAB53FC-20C9-480D-A134-6B4C72F9DD4B@microsoft.com >> I have a recordset with data that I want to filter. I use the >> filter method based my query and it filters the recordset. However, >> my question is why does it only display one row of data when the >> query should get multiple records? > You would really need to give the group the filter statement and an > explanation of what type of data (with sample values) are being > filitered. -- Reply to the group so all can participate VB.Net: "Fool me once..." Sorry about that. Here is the code:
strPartNo = 'VR234234' rsData.Filter = "fpartno = '" & strPartNo & "'" Table(recordset): fpartno fprice fid VR234234 2.15 V1-01 VR234234 1.50 V1-03 VR234234 .50 V1-02 VR345345 3.00 V4-01 VR235456 5.20 V3-01 I want to filter the above recordset and loop through the records. Currently, the filter only get the first record and not the other two. Thanks Show quoteHide quote "Alastair MacFarlane" <AlastairMacFarl***@discussions.microsoft.com> wrote in message news:1CAB53FC-20C9-480D-A134-6B4C72F9DD4B@microsoft.com... > George, > > You would really need to give the group the filter statement and an > explanation of what type of data (with sample values) are being filitered. > > Alastair MacFarlane > > "george" wrote: > >> I have a recordset with data that I want to filter. I use the filter >> method >> based my query and it filters the recordset. However, my question is why >> does it only display one row of data when the query should get multiple >> records? >> >> Thanks >> >> >> "george" <george@spamme.com> wrote in message That's not valid VB syntax; you should always copy & paste the EXACT codenews:OS2QcHETGHA.4452@TK2MSFTNGP12.phx.gbl > Sorry about that. Here is the code: > > strPartNo = 'VR234234' > rsData.Filter = "fpartno = '" & strPartNo & "'" You aren't showing the code you use to move to the first record and then> > Table(recordset): > > fpartno fprice fid > VR234234 2.15 V1-01 > VR234234 1.50 V1-03 > VR234234 .50 V1-02 > VR345345 3.00 V4-01 > VR235456 5.20 V3-01 > > I want to filter the above recordset and loop through the records. > Currently, the filter only get the first record and not the other two. loop through the recordset. -- Reply to the group so all can participate VB.Net: "Fool me once..." Sorry, here it is:
rsData.MoveFirst Do Until rsData.EOF msgbox rsData!fprice rsData.MoveNext Loop Show quoteHide quote "Bob Butler" <tiredofit@nospam.com> wrote in message news:%238rvnbETGHA.5828@TK2MSFTNGP14.phx.gbl... > "george" <george@spamme.com> wrote in message > news:OS2QcHETGHA.4452@TK2MSFTNGP12.phx.gbl >> Sorry about that. Here is the code: >> >> strPartNo = 'VR234234' > > That's not valid VB syntax; you should always copy & paste the EXACT code > >> rsData.Filter = "fpartno = '" & strPartNo & "'" >> >> Table(recordset): >> >> fpartno fprice fid >> VR234234 2.15 V1-01 >> VR234234 1.50 V1-03 >> VR234234 .50 V1-02 >> VR345345 3.00 V4-01 >> VR235456 5.20 V3-01 >> >> I want to filter the above recordset and loop through the records. >> Currently, the filter only get the first record and not the other two. > > You aren't showing the code you use to move to the first record and then > loop through the recordset. > > -- > Reply to the group so all can participate > VB.Net: "Fool me once..." > "george" <george@spamme.com> wrote in message Are you ABSOLUTELY positive that none of your fpartnos contain extraneous news:OS2QcHETGHA.4452@TK2MSFTNGP12.phx.gbl... > fpartno fprice fid > VR234234 2.15 V1-01 > VR234234 1.50 V1-03 > VR234234 .50 V1-02 > VR345345 3.00 V4-01 > VR235456 5.20 V3-01 > > I want to filter the above recordset and loop through the records. > Currently, the filter only get the first record and not the other two. spaces at the end? This may cause the filter not to match them. Jeff,
Thanks for the post. Right after I posted the code it came to me that was the problem and it was. Thanks for all the posts and sorry for my dumb mistake. Thanks Show quoteHide quote "Jeff Johnson [MVP: VB]" <i.get@enough.spam> wrote in message news:eJNiixETGHA.5924@TK2MSFTNGP09.phx.gbl... > > "george" <george@spamme.com> wrote in message > news:OS2QcHETGHA.4452@TK2MSFTNGP12.phx.gbl... > >> fpartno fprice fid >> VR234234 2.15 V1-01 >> VR234234 1.50 V1-03 >> VR234234 .50 V1-02 >> VR345345 3.00 V4-01 >> VR235456 5.20 V3-01 >> >> I want to filter the above recordset and loop through the records. >> Currently, the filter only get the first record and not the other two. > > Are you ABSOLUTELY positive that none of your fpartnos contain extraneous > spaces at the end? This may cause the filter not to match them. > On Mon, 20 Mar 2006 08:18:59 -0700, "george" <george@spamme.com> wrote: ¤ I have a recordset with data that I want to filter. I use the filter method ¤ based my query and it filters the recordset. However, my question is why ¤ does it only display one row of data when the query should get multiple ¤ records? You might want to post a sample of your code so we can see exactly what you are doing. Paul ~~~~ Microsoft MVP (Visual Basic)
Are there alternatives to using WIN32_Find_Data?
SendMessage vs. PostMessage Best ways for reading and editing text files OT: Blew away shortcut to desktop, How to replace it?? Windows 2000 Professional search for a file using vba Timer to start my program at a certain time? How to implement Link List in VB 6.0? Error Message Run-time error 523 Question about Strings to Numbers |
|||||||||||||||||||||||