List Box of Reports - Filtering Result

RichardP1978

Registered User.
Local time
Today, 22:49
Joined
Nov 14, 2006
Messages
89
http://allenbrowne.com/ser-19.html

I use the call back function to generate my list of reports in a list box.

I chose to use this method as it seems like an easy way to do what I want, and to a certain extent understand how it works.

What I would really like to be able to do, is have it filter the list of reports.

For example, some reports are for me working behind the scenes, and also so many are subreports that go in to the main report so dont need listing.

I would like to have a report names 'Clients Full Report', 'Clients Medication Report' etc on the list (I dont mind changing report names as I think that will be the key to making it work) So many of my sub reports have client in its name, so if a report could be named '1Clients Main Report' and the code looks for the number 1 and removes the 1 from the list so it displays Clients Main Report on the list.

So its just a way to make the list box only include specific reports based on a number.

Any suggestions?
 
what you need to do is to rename those reports you do not to appears in the list ie.

All main reports give a prefix of rpt
all sub reports srpt
all other reports a different prefix. then in the call back routine only load those reports that begin with rpt.

ie if left$(ReportName,3)="rpt" then etc
 
Last edited:
What I do, is create report table(s). That is, one table listing all reports, having their actual name, the name I wish the user to identify it with, then I can also store other relevant properties (margins, different user preferences...). This means you list will only contain the reports you wish the user to see.

This also gives opportunity of presenting the same report with different names to the user, so one can use the same report design with different recordsources, different sorting and grouping etc. With an additional referencing table, I could for instance list the fields users are allowed use for filter, list different fields on which the user can sort/group on etc... so I think this approach gives more opportunities than using the system table or documents collection.

Naming conventions:
You will find more than one recommending against spaces and special characters in names of objects.
Also, I've read somewhere that one should be carefull naming Access objects something starting with a number, as at least someone at the time thought that could be dangerous. I don't know, as I've never done it, but mention it just in case - perhaps others have experience?
 
what you need to do is to rename those reports you do not to appears in the list ie.

All main reports give a prefix of rpt
all sub reports srpt
all other reports a different prefix. then in the call back routine only load those reports that begin with rpt.

ie if left$(ReportName,3)="rpt" then etc

Thanks for that, I can see how it would work but I have got no idea at what stage to integrate that in of the code and I assume it would have to be around an if statement due to the then at the end of that line.
 
Thanks Roy, I quite like your idea, one or two users will need certain parameters set for them and this seems like a good idea. Do you know if there is a sample database that would show me the idea of the tables you mention and how to reference them within code etc?

I dont use spaces in names of tables, queries etc, it does cause a major headache, I was more saying wanted the report list to look nice with spaces, but I wouldnt rename the actual files.
 
I don't know of any sample dbs, I'm afraid, but I think one part is listing the relevant reports, the other is to "roll you own" openreport method, where you check which report name is passed, open the report table(s), check out the properties and apply them when opening the actual report.
 
I don't know of any sample dbs, I'm afraid, but I think one part is listing the relevant reports, the other is to "roll you own" openreport method, where you check which report name is passed, open the report table(s), check out the properties and apply them when opening the actual report.


Would this be along the lines, except the person who is not accepting the advice! lol

http://www.mcse.ms/message2425490.html
 

Users who are viewing this thread

Back
Top Bottom