Solved

Reporting a specific range of entries

Posted on 1999-01-14
10
201 Views
Last Modified: 2006-11-17
This is probably a simple question for those experienced in Access97 or those with a book, so I'm setting it at 100 points.  I'll raise it if the solution is more complicated than normal.

I have a client database for my business, and I'd like to report the charges that have been made during a specific date range.  Using some sample databases I managed to get the report to request the date range (and it successfully shows in the report "Billing from [datex] to [datey]")

I can't find any info in the code or anything in the sample databases that do this... I'm probably leaving out a lot, please feel free to ask me to elaborate on more.

- Hugh Buchanan
- HarveyOpolis

0
Comment
Question by:libido011397
  • 5
  • 4
10 Comments
 
LVL 7

Expert Comment

by:Dedushka
ID: 1973614
Hi, libido!

Here is samle from Access on-line help:
---------
This example lists the name and contact of every customer who placed an order in the second quarter of 1995.
This example calls the EnumFields procedure, which you can find in the SELECT statement example.

Sub SubQueryX()

      Dim dbs As Database, rst As Recordset

      ' Modify this line to include the path to Northwind
      ' on your computer.
      Set dbs = OpenDatabase("Northwind.mdb")
      
      ' List the name and contact of every customer
      ' who placed an order in the second quarter of
      ' 1995.
      Set rst = dbs.OpenRecordset("SELECT ContactName," _
            & " CompanyName, ContactTitle, Phone" _
            & " FROM Customers" _
            & " WHERE CustomerID" _
            & " IN (SELECT CustomerID FROM Orders" _

& " WHERE OrderDate Between #04/1/95#" _
            & " And #07/1/95#);")
      
      ' Populate the Recordset.
      rst.MoveLast
      
      ' Call EnumFields to print the contents of the
      ' Recordset. Pass the Recordset object and desired
      ' field width.
      EnumFields rst, 25

      dbs.Close

End Sub
--------

Hope it will help you.

Good luck,
Dedushka
0
 
LVL 1

Expert Comment

by:billinb
ID: 1973615
It sounds like you just need to enter the parameters into the underlying query of the report.
There are several ways to do this, I think the following MS site has an excellent example -

Q141613
(After bringing the report's underlying query up in design mode, by either clicking the data source in the report, or creating a new query entirely;)
On the Query menu, click Parameters. In the Query Parameters box, under Parameters, type "Enter Start Date" (without the quotation marks), and under Data Type enter "Date/time" (without the quotation marks). Press TAB to move to the next Parameter field. Under Parameters, type "Enter End Date" (without the quotation marks) and under Data Type, enter "Date/time" (without the quotation marks). Click OK.
.etc...
Add the following criteria for the (Billing) field:
      Between [Enter Start Date] And [Enter End Date]
0
 

Author Comment

by:libido011397
ID: 1973616
Hate to ask.. but... what do I do with that?  Does this go in teh report code thing?
0
 
LVL 7

Expert Comment

by:Dedushka
ID: 1973617
libido,
it is not answer, it's only comment...
If you want to create report about "the charges that have been made during a specific date range", then you should
1.Create the Charges table
2.Create query, that select fields needed for your report
3.Create report based on above mentioned query
4.Open your report directly or using button on the form.

If you want open your report directly from database window, then your query must inlcude parameters, as discribed in billinb's answer.
if you want to use a button, then you should attach to this button's OnClick event some code:
.
DoCmd.OpenReport "MyReport",,,"[ChargedDate] between #" & me.[datex]& "# AND #" & me.[datey] & "#"
.

where datex and datey is text boxes, placed on your form.

Best regards,
Dedushka
0
 

Author Comment

by:libido011397
ID: 1973618
Could you explain more... I am unsure how to even create a query under the report.  The example database that lists things by date doesn't have any queries.


0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:libido011397
ID: 1973619
Well, I have created a query.. which contains only the BillingDate table entry.. (should it have more?)

How do I link the Query to the form, etc?
0
 
LVL 7

Expert Comment

by:Dedushka
ID: 1973620
libido,
please post here your table's structure
0
 

Author Comment

by:libido011397
ID: 1973621
Well, it's a fairly simple table:

Billing : Table
ContactID - Number (linked to Contacts : Table)
BillingID - AutoNumber
PaymentAmount - Currency
Payment Date - Date/Time
CreditCardNumber - Text
CreditCardExpDate - Text
0
 
LVL 7

Accepted Solution

by:
Dedushka earned 100 total points
ID: 1973622
Here i am, libido.

In 40-50 minutes i can prepare for you sample database and send it to you, OK?

Dedushka
0
 
LVL 7

Expert Comment

by:Dedushka
ID: 1973623
libido,
sample database is ready and wait for your e-mail. Write me to khamed@istnet.ru or let me know here.

Regards,
Dedushka
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now