Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 12-10-2002, 07:21 PM   #1
Member (7 bit)
 
Join Date: Oct 2001
Location: Essex, United Kingdom
Posts: 124
Question Another Access Query

I'm trying to write a report in access to show me all sales made between any two dates (selected by the user).

I'm not sure how to go about this as from what I see you cant use command buttons on reports and thats the only way I can think to do it?!

Please has anyone got an explanation of how this can be done?

Thanks
mrstarface is offline   Reply With Quote
Old 12-10-2002, 09:56 PM   #2
Member (7 bit)
 
RoyKelly's Avatar
 
Join Date: Sep 2002
Location: Pueblo, Colorado
Posts: 101
Hi mrstarface!

One of the places I go for help in Access is http://www.access-programmers.co.uk/ They also have forums for troubleshooting/learning Access.

Another place is http://www.utteraccess.com/ They have a food forum too.

I have a database with a screen that pops up when I select a report. It asks for the start date and end date, but I cannot remember how I did it four years ago.

I just did a quick search on both forums, but did not find anything there about your question. Try joining their forums and posting your question there too. There are a lot of people that know more than I do there.

You might also try using Google to search for the answer to your question

Hope this is of some help

Last edited by RoyKelly; 12-10-2002 at 11:36 PM.
RoyKelly is offline   Reply With Quote
Old 12-11-2002, 08:28 AM   #3
Member (11 bit)
 
sdkfz's Avatar
 
Join Date: Dec 2001
Location: Shakopee MN
Posts: 1,293
In the query that hits the data table you need to have a date field(date of sale or what ever this date is called) and then in the row called Criteria for this date field (in a select query it is top to bottom "Field"-"Table"- "Sort" -"Show"- "Criteria" and finally "or") you put in

Between [Type in Beginning Date:] And [Type the ending date:]

you can change the wording inside the brackets if you like. This is called a parameter (check out help in access.)

Every time the query is run the user will be asked with two pop up windows for the date ranges. What you put inside the square brackets is what shows up on the pop up window.

You can also place this date range in the report header so you only need to develop one report, depending on the date range entered then makes your one report a universal one. To do this place a text box in the header and the control source is exactly the same as what is in the square brackets. (you need one for each range of course!) so for example

Label with "This report is for sales between"
Text box with the control source "Type in Beginning Date:"
Label with "And"
Text box with control source "Type the ending date:"

align these all horizontally.

Hope this helped
edit
Also... put in another label and text box with the label "Current date" and the text box with control source set to "=Now()" so you know when the report was run...
end edit

Last edited by sdkfz; 12-11-2002 at 08:37 AM.
sdkfz is offline   Reply With Quote
Old 12-12-2002, 10:04 AM   #4
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
If you have a lot of reports like that, the best thing to do is to create a report-generating form. That form can have text boxes for From and To dates, as well as any other information you would like, with a button for each report that you have. When you click the button, the appropriate dates are put into the query and the report is opened. This makes it easy to print reports, as they are all in one place. Depending on how sophisticated you want to make it, you can even add shortcut buttons to automatically fill in the dates for this month, year to date, or any combination you want.
doctorgonzo is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:27 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2