Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / February 2006

Tip: Looking for answers? Try searching our database.

Creating reports based on specific criteria

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Demetri - 28 Feb 2006 18:22 GMT
My customer database includes various customer information (name, address,
metro area…etc.), for which I would like to display in a report for an
individual customer or a group of customers based on specific criteria.  I
currently have the reports designed...however, I would like to be able to
select which customers’ information will be displayed in the report by
customer name or metro area.  I understand that this can been accomplished
via a report query, but I am looking for a more user friendly method, which
will allow the database user to easily insert the criteria without accessing
the report query.  Perhaps this can be accomplished with a lookup field
within the report interface?

Thanks in advance.
Marshall Barton - 28 Feb 2006 19:44 GMT
>My customer database includes various customer information (name, address,
>metro area…etc.), for which I would like to display in a report for an
[quoted text clipped - 6 lines]
>the report query.  Perhaps this can be accomplished with a lookup field
>within the report interface?

You should use a form to provide a place for users to enter
the criteria in text or combo boxes.  Then you can also have
a button on the form that's used to prepare the criteria and
open the report.  The OpenReport method's WhereCondition
argument can be used to filter the report's data without the
report or its query being aware of the filter.

Let's say you have two combo box's, one for customer and one
for area, then the button's Click event procedure would look
like:

Dim stWhere As string
Dim stDoc As String
stDoc = "nameofreport"
If Not IsNull(Me.cboNames) Then
    stWhere = stWhere & " And [Name]=""" & Me.cboNames & """"
End If
If Not IsNull(Me.cboAreas) Then
    stWhere = stWhere & " And [Name]=""" & Me.cboAreas & """"
End If
DoCmd.OpenReport stDoc, acViewPreview, , stWhere

Signature

Marsh
MVP [MS Access]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.