Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter By Form - Recordset 1

Status
Not open for further replies.

Basia

Programmer
Apr 27, 2001
64
ML
Greetings. I currently have a form that allows users to Filter by Form on a customized tool bar. Everything works great. From this form users can filter records that they want and then open up another form which allow them to create an email to be sent to all the records in the filtered recordset.

My problem is that I do not know how to loop through this recordset created by filter-by-form. How do I refer to it?

Dim rst as recordset

set rst = ???? (I was using me!filter, but does not work)

Any help is MUCH appreciated!

Thanks...Basia
 
Use the following code
***
Dim rst as dao.recordset

set rst = me.recordsetclone
***

If you apply a filter to the form, the filter is also applied to the recordsetclone.

Seaport
 
Thanks for the response. When I try it, I get an error:

"User defined type not defined."

Do I need to check off DAO under some option?

Let me know...Basia
 
OK, I believe you are using Access2000, which use ADO as the default data access object model. All you need to do is to add DAO to the reference of your database. In the VB editor, go to Tools-Reference to add "Microsoft DAO 3.6 Object Model," then the code should run OK.


Seaport
 
Thank you so much! Works great.

Basia :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top