Quick Search for:  in language:    
often,case,developer,will,need,create,Access,
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
SQL Stats

 Code: 44,501. lines
 Jobs: 115. postings

 How to support the site

 
Sponsored by:

 
You are in:
 

Does your code think in ink?
Login





Latest Code Ticker for SQL.
Group Data Values
By Thivya Prabakaran on 11/29


Grouping Data
By Thivya Prabakaran on 11/29


Separating Function
By Jayanthi Venugopal on 11/27


Filter duplicate records from a table
By Geoff Kazzi on 11/25


qStats_Ex
By Ewald Hofman on 11/19


find depended objects
By chandra sekhar on 11/19


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!

Affiliate Sites



 
 
   

Access 2000: Controlling Report Data

Print
Email
 

Submitted on: 10/9/2002 6:19:01 PM
By: David Nishimoto 
Level: Beginner
User Rating: By 2 Users
Compatibility:SQL Server 2000, SQL Server 7.0

Users have accessed this article 4223 times.
 
(About the author)
 
     It is often the case a developer will need to create an Access 2000 reports application capable of data selection. For example, all transactions for a member. The data is input as parameters with in a form and passed to the report as query criteria. This is the simplest method to control report output resulting from user selected data criteria.

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
David Nishimoto
davepamn@relia.net
Access 2000: Launching a report

It is often the case a developer will need to create an Access 2000 reports application capable of data selection. For example, all transactions for a member. The data is input as parameters with in a form and passed to the report as query criteria. This is the simplest method to control report output resulting from user selected data criteria.

Table Transactions
Fields and Types
MemberIdNumber
PostedDatePostedDater
AmountDouble
CodeNumber
Create a query called qryTransactions
	include memberid, posteddate,amount, and code in the query field list
Create a columar report called rptTransactions
	Step 1: Use the report Wizard 
	Step 2: Select qryTransactions as the data source
	Step 3: Select all fields
	Step 4: Group on memberid
	Step 5: Select Tabular type
	Step 6: Name the report rptTransactions
Create a form called frmReportParameters
	Step 1: Design View
	Step 2: Add a text field called txtMemberId
	Step 3: Change the label to read "Member Id"
	Step 4: Add a button named "cmdLaunchTransactionReport" and labeled "Launch Report"
	Step 5: Save the form as frmReportParameters
Launch the Code
	Step 1: Make sure your in form design
	Step 2: Press the code button
	Step 3: Add a Click event for the cmdLaunchTransactionReport button

The following code will limit data selection to records matching
a specific member id. The report will open in preview mode. Only
transactions with a specific member id will be displayed.

Option Explicit
Option Compare Database
Private Sub cmdLaunchTransactionReport_Click()
On Error GoTo Err_cmdLaunchTransactionReport_Click
 Dim stDocName As String
 Dim stLinkCriteria As String
 Dim sCriteria
 sCriteria = "[MemberId]=" & txtMemberId
 stDocName = "rptTransactions"
 DoCmd.OpenReport stDocName, acViewPreview, , sCriteria, acWindowNormal
Exit_cmdLaunchTransactionReport_Click:
 Exit Sub
Err_cmdLaunchTransactionReport_Click:
 msgbox Err.Description
 Resume Exit_cmdLaunchTransactionReport_Click
End Sub
Run the Form
Step 1: Press F5
Step 2: Enter in a Member Id
Step 3: Press the Launch Report Button
Step 4: Review your report


Other 9 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this article(in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
8/27/2003 1:31:51 PM:Mike J Anderson
Actually you can do it much easier with a parameter query.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this article has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular article, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | SQL Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.