Solved

Can I access a filtered recordset with VBA

Posted on 2008-09-30
1
419 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
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…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

808 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