Solved

Can I access a filtered recordset with VBA

Posted on 2008-09-30
1
430 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

749 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