Solved

Can I access a filtered recordset with VBA

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access 2016 importing text files 13 20
making call from microsoft access to skype for business 5 44
Any Way to Print an Import Spec? 3 29
DCount Type Mismatch 2 21
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

785 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