Solved

Reporting a specific range of entries

Posted on 1999-01-14
10
202 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

863 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

23 Experts available now in Live!

Get 1:1 Help Now