If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Ask the user to select report parameters
Hi all
I used to be able to do this, but have lost all the Access knowledge I once had through lack of use. I have a table (plus query, plus form) of staff absences and I want to report on staff absences over a certain period. When I choose the report I want to be asked the start date and end date of the report. How do I do it again? I used to know all this ... :-( Thanks for reading. Dominic |
#2
|
|||
|
|||
Ask the user to select report parameters
Dominic wrote:
I used to be able to do this, but have lost all the Access knowledge I once had through lack of use. I have a table (plus query, plus form) of staff absences and I want to report on staff absences over a certain period. When I choose the report I want to be asked the start date and end date of the report. That is really a crude way to do things, you can just set the date field's criteria to something like: Between [Enter start date] And [Enter end date] Way better would be to use a form with two text boxes for the dates and a button to do open the report. With this approach, the code behind the button would use the OpenReport method's WhereCondition argument to filter the report. Then code could be something like: strWhere = "[the date field] Between " & Format(txtStart, "\#yyyy-m-d\#") & " And " & Format(txtEnd, "\#yyyy-m-d\#") -- Marsh MVP [MS Access] |
#3
|
|||
|
|||
Ask the user to select report parameters
Hi Marshall
That's great. I will use the "crude" way for now, but using the fancy form sounds like a great idea and is definitely the way to go. Thanks for the tips and your time. Dominic "Marshall Barton" wrote: Dominic wrote: I used to be able to do this, but have lost all the Access knowledge I once had through lack of use. I have a table (plus query, plus form) of staff absences and I want to report on staff absences over a certain period. When I choose the report I want to be asked the start date and end date of the report. That is really a crude way to do things, you can just set the date field's criteria to something like: Between [Enter start date] And [Enter end date] Way better would be to use a form with two text boxes for the dates and a button to do open the report. With this approach, the code behind the button would use the OpenReport method's WhereCondition argument to filter the report. Then code could be something like: strWhere = "[the date field] Between " & Format(txtStart, "\#yyyy-m-d\#") & " And " & Format(txtEnd, "\#yyyy-m-d\#") -- Marsh MVP [MS Access] |
Thread Tools | |
Display Modes | |
|
|