Solved

Can I access a filtered recordset with VBA

Posted on 2008-09-30
1
378 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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ListBox on Access form 19 27
Access VBA Form - Filter Multiple and/or 7 32
Syntax error with between dates 6 16
Resize text 4 14
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

763 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

12 Experts available now in Live!

Get 1:1 Help Now