Avatar of waverobber
waverobber
Flag for United States of America asked on

ACCESS DATA SHEET DISPLAY

Hello,
I have an Access 2007 database in which I allow the user to custom build a query. This is done via a series of check boxes. For example: 1) Show all members who are paying by credit card AND the member has not chosen to skip AND the member has not cancelled, etc.

From the information provided by the user in the check box group, I am building a SQL string. The string becomes a query definition and the query is executed. Currently, the user is shown the custom filtered information in a datasheet format.

Here's my question: The user doesn't care about the filtered data (datasheet view). All the user wants/needs to see is the number of members who fit the criteria selected. How is this done?
Microsoft Access

Avatar of undefined
Last Comment
waverobber

8/22/2022 - Mon
IrogSinta

He's one way:
DIM rs As Recordset

SET rs = currentDB.OpenRecordset(strSQL)
If rs.EOF Then 
    Me.txtResult = 0
Else
    rs.MoveLast
    Me.txtResult = rs.RecordCount
End If

Open in new window

Ron
ASKER CERTIFIED SOLUTION
Scott McDaniel (EE MVE )

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
waverobber

ASKER
Works perfect. Thanks...
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck