Solved

Can I access a filtered recordset with VBA

Posted on 2008-09-30
1
395 Views
Last Modified: 2013-11-27
In an Access form a recordset can be filtered by using the standard MS-Access filter buttons. Is it then possible to loop through that filtered recordset with VBA?
0
Comment
Question by:Robijef
1 Comment
 
LVL 14

Accepted Solution

by:
pteranodon72 earned 250 total points
ID: 22605832
If you reference the recordsetclone property of the form, it will reflect the current filtering of the forms recordsource (as well as positioning within that recordset).


Dim rs as DAO.Recordset

Set rs = Me.RecordsetClone

rs.MoveFirst
While rs.EOF = False

'Do your thing here

rs.MoveNext
Wend

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now