PipMic
asked on
Extract Report (preview) from a subform
Hi all,
I am attaching part of a database which provides a search facility but I am hoping whether someone can assist me with the following problem.
I have the object frm_Sections which provides the filtering of sections. When a section or sections are highlighted the components of each section highlighted will appear in the subform.
My question is: How can I then produce a report based on the results which appears in the subform.?
Grateful once again for the assistance.
Please note that the database is done with A97.
SP-ver-EE.mdb
I am attaching part of a database which provides a search facility but I am hoping whether someone can assist me with the following problem.
I have the object frm_Sections which provides the filtering of sections. When a section or sections are highlighted the components of each section highlighted will appear in the subform.
My question is: How can I then produce a report based on the results which appears in the subform.?
Grateful once again for the assistance.
Please note that the database is done with A97.
SP-ver-EE.mdb
I can't open your mdb file on the computer I'm sitting at... You would need to use the same logic in the design of your report (based on highlighted selections of your frm_Sections) as you use for your form/subforms.
ASKER
Not sure I understand!
ASKER
My idea is to have a print preview button on the form which when pressed would provide a preview of a report with the entries as displayed in the subform...
Not quite sure what you mean by:
You would need to use the same logic in the design of your report (based on highlighted selections of your frm_Sections) as you use for your form/subforms.
Not quite sure what you mean by:
You would need to use the same logic in the design of your report (based on highlighted selections of your frm_Sections) as you use for your form/subforms.
In the OnOpen event for your report set the RecordSource to your subform's recordsource like this:
Me.RecordSource = Forms!frm_Sections!cntDail s.Form.Rec ordSource
As an aside, you should use the ItemsSelected collection to get the list of items selected rather than go through each item selected or not.
Ron
Me.RecordSource = Forms!frm_Sections!cntDail
As an aside, you should use the ItemsSelected collection to get the list of items selected rather than go through each item selected or not.
Ron
Sorry, difficult for me to be precise when I can't see your db. If you call the report from a button on the form, you can refer to the current values of controls on the form to determine which sections of the report to show, or, you can filter the datasource of the report on the current values of controls to filter it.
ASKER
I have tried that ....as you've suggested but I can't create the report!
However I am interested to know how to carry out the process you suggest, i.e from the itemsSelected collection rather than the go through each item selected or not.
However I am interested to know how to carry out the process you suggest, i.e from the itemsSelected collection rather than the go through each item selected or not.
ASKER
Simon , I think that is what Irog (above) is suggesting but I don't know how to do that.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Iroq,
I can't seem to download your sample database!
I can't seem to download your sample database!
ASKER
Got it thanks....
working on it
working on it
ASKER
Thanks,
Iroq it works a treat.....
In your sample you have actually set it up, looking at the highlighted records in the subform.
I will look up this VBA Function.
Iroq it works a treat.....
In your sample you have actually set it up, looking at the highlighted records in the subform.
I will look up this VBA Function.