Pharma Down
Registered User.
- Local time
- Today, 15:27
- Joined
- Dec 1, 2011
- Messages
- 67
I have asked this question before, but failed in implementing the answers!!
I have created a database to collect info via forms on (for example) errors/incidents that occur at a specified site and relate to other specified details (such as who is responsibile for the incident, who investigated and dates).
I would like to create a system so that a user (with no knowledge of Access) can open a form a, specify parameters, click a button and the report would print. The parameters that would commonly need to be defined before printing a report would be things such as:
- all errors between date 1 and date 2
- all errors relating to a selected site/person etc (between specified dates)
I envisage a system whereby the user completes fields in a form to set the parameters, then clicks a button and the form prints, or: they hit a button to print and then a box flashes up to ask for parameters to be set.
I tried an example and added this, via the 'On_Click':
DoCmd.OpenReport "Rpt_interventions_all", , , "FieldName = '" & Me.Name & "'"
(Because the report name is Rpt_interventions_all and the field name that I want to search with is Name)
I clicked on the button (to which I had added the code); I was asked for the field value that I wanted (not sure why it didn't automatically select the value that was showing in the field), but it threw up another window behind the one asking for the field value (couldn't read it)... it then printed a page from the report.
Not understanding why it printed rather than opened the report I thought I could be clever and added a little (copying from elsewhere, not understanding what I am doing):
DoCmd.OpenReport, acPreview, "Rpt_interventions_all", , , "FieldName = '" & Me.Name & "'"
Something in the code builder turned bright yellow and Access locked up until I deleted the code!
I have looked at http://www.baldyweb.com/multiselect.htm - a multiselect box to filter a report and I imagine this might do part of what I want, but I have no idea of what a multiselect box is or how to add one. I think that I would want a multiselect box, to select one or multiple sites/people, but I would also want to filter the report based on a timeframe - is this possible (ie multiselect box plus filtering for records between user-defined dates Date 1 and Date 2)?
Please can someone advise me (considering I don't understand coding!)?
Thank you
Andy
I have created a database to collect info via forms on (for example) errors/incidents that occur at a specified site and relate to other specified details (such as who is responsibile for the incident, who investigated and dates).
I would like to create a system so that a user (with no knowledge of Access) can open a form a, specify parameters, click a button and the report would print. The parameters that would commonly need to be defined before printing a report would be things such as:
- all errors between date 1 and date 2
- all errors relating to a selected site/person etc (between specified dates)
I envisage a system whereby the user completes fields in a form to set the parameters, then clicks a button and the form prints, or: they hit a button to print and then a box flashes up to ask for parameters to be set.
I tried an example and added this, via the 'On_Click':
DoCmd.OpenReport "Rpt_interventions_all", , , "FieldName = '" & Me.Name & "'"
(Because the report name is Rpt_interventions_all and the field name that I want to search with is Name)
I clicked on the button (to which I had added the code); I was asked for the field value that I wanted (not sure why it didn't automatically select the value that was showing in the field), but it threw up another window behind the one asking for the field value (couldn't read it)... it then printed a page from the report.
Not understanding why it printed rather than opened the report I thought I could be clever and added a little (copying from elsewhere, not understanding what I am doing):
DoCmd.OpenReport, acPreview, "Rpt_interventions_all", , , "FieldName = '" & Me.Name & "'"
Something in the code builder turned bright yellow and Access locked up until I deleted the code!
I have looked at http://www.baldyweb.com/multiselect.htm - a multiselect box to filter a report and I imagine this might do part of what I want, but I have no idea of what a multiselect box is or how to add one. I think that I would want a multiselect box, to select one or multiple sites/people, but I would also want to filter the report based on a timeframe - is this possible (ie multiselect box plus filtering for records between user-defined dates Date 1 and Date 2)?
Please can someone advise me (considering I don't understand coding!)?
Thank you
Andy