Mar 15 2005, 03:03 PM
I am building a database and am now to the point where I have reports developed and a lot of data to base the reports on. I want to build a report "menu" that will allow the user to select a particular record and then run a report based on the ID of the record selected. Anyone know of some controls out there or links that deal with this?
Mar 15 2005, 03:11 PM
To open a report based on a form control you need to add the criteria in the report open command...
for example if you had a form with a control on it called ID and in there was the number 23, using the following line of code would open the report and only show the record with the ID of 23...
DoCmd.OpenReport "ReportName", acViewPreview, , "ID=" & Me.ID
There any plenty of variations with this (i.e. list boxes, text boxes, combo boxes, bound controls, unbound controls but they all work very much the same)
Mar 15 2005, 05:05 PM
Thanks very much for the post. It was a big help. Last question:
If I want to return multiple IDs what would that code look like?
Mar 15 2005, 05:10 PM
Would you want each ID on a seperate report?
If so then check out this recent post...http://www.utteraccess.com/forums/showflat...p;Number=654085
If not then you would need a multi select list box.
See this post in the code archive by Jerry "Gandalf" Dennisonhttp://www.utteraccess.com/forums/showflat...mp;Number=95097