From: Johnny-Walker via AccessMonster.com on 12 Mar 2010 17:31 I am using a macro to open 5 seperate reports but when I open a report you have to use an assigned ID number to retrieve the right employee information you are looking for. At present you have to enter the employee ID # all 5 times for each report, how can I set this up to open up all 5 reports without having to enter employee ID number all 5 times? -- Message posted via http://www.accessmonster.com
From: Marshall Barton on 12 Mar 2010 18:02 Johnny-Walker via AccessMonster.com wrote: >I am using a macro to open 5 seperate reports but when I open a report you >have to use an assigned ID number to retrieve the right employee information >you are looking for. At present you have to enter the employee ID # all 5 >times for each report, how can I set this up to open up all 5 reports without >having to enter employee ID number all 5 times? Create a form with a text or combo box for the ID and a button to open the report. Remove the ID criteria from the reports' record source queries. The code for the button's Click event procedure could look something like: Dim stWhere As String stWhere = "ID=" & Me.ID 'not sure about your field names DoCmd.OpenReport "first report", acViewPreview, , stWhere DoCmd.OpenReport "2nd report", acViewPreview, , stWhere DoCmd.OpenReport "3rd report", acViewPreview, , stWhere DoCmd.OpenReport "4th report", acViewPreview, , stWhere DoCmd.OpenReport "5th report", acViewPreview, , stWhere -- Marsh MVP [MS Access]
|
Pages: 1 Prev: Report Input Parameters Next: Cannot get graph to work properly |