Uzibat
03-12-2000, 08:30 AM
I am creating a query where I need to be able to view the total sales made by a person for each year and I can do this fine. The problem is, I need the year to start at 1st September every year and end on 31st August. How do I do this?
If you could help,I would be eternally grateful.
Carol
03-12-2000, 08:46 PM
Attach a parameter to your query where the user inputs a beginning date and an ending date for the field. Thereby getting your report for any selection of months. An easy way would be to have a dialog box with 2 unbound fields. One field would be called beginning date and the other field would be called ending date.
Cosmos75
04-29-2002, 09:42 AM
Carol,
How do I do what you suggested? How do I make a dialong box? What do you mean by unbound? Can I make the dialog box have a listbox/combobox/pull down menu for Month and Year?
David R
04-29-2002, 12:23 PM
You can do lots of things with unbound forms, also called "popup forms". They work a lot like Parameters in queries, except that you can put more than one value on a form at once, provide error checking, and use combo and list boxes to reduce error/work.
An unbound form just means it has no Control Source; it is not based on any table or query anywhere. All it has is fields to be filled in and then those field values can be used elsewhere to "do things" - what those things are depends on what you're trying to do.
For example, a popup form to run a query/report could have two boxes on it, labeled Start Date: and End Date:. In the query you could have used popup boxes for [Enter start date:] and [Enter end date:]. In this example, though, the date field Criteria would be something like:
Between Forms!PopupForm!StartDateBox And Forms!PopupForm!EndDateBox
and as long as that popup form is open, you can refer to its fields for your queries, reports, whatever. You can close it at the end with DoCmd.Close acForm, "PopupForm" after it's done its job.
You can use combo boxes for dates, but there is also a CalendarControl in the MS Access Toolbox that you can use to choose dates. I think it's under the last toolbox option in the Toolbox when you're designing a form.
Cosmos75
05-01-2002, 12:26 PM
I am afriad, you lost me, David. Is a pop-up form a form I create normaly using Design-view?
"You can close it at the end with DoCmd.Close acForm, "PopupForm" after it's done its job." - Where does this go??
It's not that you explained it bad, it's that I don't know enough about ACCESS to understand it.
THANKS!
David R
05-01-2002, 02:41 PM
Yes, a popup form is created with the usual method. You can specify in Form Properties that it is Popup (stays on top of all other forms/windows), and/or Modal (retains the focus until closed - you can't do anything else until it's gone).
You can also open a regular form as Popup, Modal with the options to DoCmd.OpenForm, but that is spelled out in the help file.
The statement DoCmd.Close acForm, "PopupForm" goes at the very end of the Run button for the popup form. Since something else will have the focus by then, you have to specify which form to close. Again DoCmd.Close is marginally instructive (I mean that in all seriousness - Access help is NOT the best).
Good luck,
David R