Minggu, 20 Mei 2012

RE: [MS_AccessPros] Report Criteria

 

Toukey-

If these are three separate reports, use code triggered either by After Update
of the selection or a command button to look at the choice and open the
appropriate report. Let's say the choice is in a combo box and triggered by a
command button. The code might look like:

Private Sub cmdOpenReport_Click()
' Figure out which report to open
Select Case Me.cmbReportSelect
Case "Insurer"
DoCmd.OpenReport "rptInsurer", acViewPreview
Case "Claim Status"
DoCmd.OpenReport "rptClaimStatus", acViewPreview
Case "Type of Claim"
DoCmd.OpenReport "rptTypeOfClaim", acViewPreview
End Select
End Sub

You could even be a bit slick about it and put the companion report name in a
hidden column of the combo box. Then all your code needs to do is open the
selected report:

DoCmd.OpenReport Me.cmbReportSelect.Column(1), acViewPreview

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----------------------------------

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of toukey1
Sent: Sunday, May 20, 2012 9:39 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Report Criteria

 
Hi,

I would appreciate any assistance with a report that is based on input from the
user. For example, I would like the user to be able to select any or all of the
three options below:

Insurer
Claim Status
Type of Claim

I know I can create a form with the above which the user selects but how do I
get the report to run based on the selection by the user?

Regards
Toukey

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar