I would suggest ubound controls on your form to enter the date range.
If you want to use a popup form to enter the dates, that is okay, but it
does complicate the coding to some degree.
You could open a form where you could enter the dates and run the report
form that form. That would be about the most simple way to do it.
I do something similar in one of my apps, but it is a tab on the main
dashboard form for selecting reports. Once the user chooses a report from a
combo box that lists all the reports, they use a command button to run the
report. The command button one of 3 for preview, print, or export to Excel.
All 3 buttons open a form the user uses to select parameters depending on the
report.
Then, in the Close event of the report, I close the form that opened it.
It is a bit different when the user selects to export to Excel, but that is
the basics of it.
--
Dave Hargis, Microsoft Access MVP
Frustrated said:
Ok
I only have One Field with Dates in it. I want to be able to click on the
command button and be offered a start date dialogue box and then a end date
dialogue box the dates i type in are is the range i want to show all records
for that are within the dates entered. I know in query "Between [Start Date]
and [End Date]" will work but i was hoping to do this in a form
Klatuu said:
Your question is a bit vague to answer in detail, but to create an event
procedure for a command button, you open the properties dialog box for the
button, select the Events tab and click the small command button with the 3
dots on it just to the right of the On Click event text box. Then select Code
Builder from the popup menu.
The VB Editor will open with the cursor positioned in the sub for the event.
Now, you have to create the code you need to return the data. If you are
going to search for data within a range of dates, you will need two text
boxes on your form for the Start and End dates. What you do next depends on
where the data is you want to retrieve and what you want to do with it.
If you can provide a bit more detail, perhaps we can explain how to get what
you want.
--
Dave Hargis, Microsoft Access MVP
:
Hi if you can help i have a Form on our Club Database Access 2002 i want to
be able to create an [Event Procedure] on the form that will allow me to
search a Field Name "DateofRenewal" for all data between two dates and
possibly attache this Event to a button?