If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Changing the record source depending on user selection
I built a report that relies on a query "SalesByDepartment". I built an
identical report which relies on a query called "SalesByBusinessUnit. I also created an option group on a form, so that when you choose Department, it will print the department report and if you choose Business Unit it will print hte other report. I am about to built another identical reports by area, chapter etc and was wondering if there is a way to change to record source of the SAME report from "SalesByDepartment" to "SalesByBusinessUnit. I would also like to change some text box caption and control source based on a user selection and thus saving a lot of time and hassle. Thanks in advance for your help. Arnon |
#2
|
|||
|
|||
Changing the record source depending on user selection
Arnon wrote:
I built a report that relies on a query "SalesByDepartment". I built an identical report which relies on a query called "SalesByBusinessUnit. I also created an option group on a form, so that when you choose Department, it will print the department report and if you choose Business Unit it will print hte other report. I am about to built another identical reports by area, chapter etc and was wondering if there is a way to change to record source of the SAME report from "SalesByDepartment" to "SalesByBusinessUnit. I would also like to change some text box caption and control source based on a user selection and thus saving a lot of time and hassle. You can do all that in the report's Open event procedu Dim strQuery As String Select Case Forms!theform.theoptiongroup Case 1 Me.RecordSource = "SalesByDepartment" Me.lblTitle.Caption = "Department Sales Report" . . . Case 2 Me.RecordSource = "BusinessUnitReport" Me.lblTitle.Caption = "Unit Sales Report" . . . Case 3 Me.RecordSource = "SalesByBusinessArea" Me.lblTitle.Caption = "Area Sales Report" . . . Case 4 Me.RecordSource = "SalesByBusinessChapter" Me.lblTitle.Caption = "Have a nice day" . . . Case Else MsgBox "Need to add the new query to this list" End Select -- Marsh MVP [MS Access] |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiple filter query of form | truepantera | Using Forms | 6 | August 4th, 2005 08:26 AM |
User Saving a Record else it deletes | Carter Wexler | Using Forms | 1 | August 2nd, 2005 11:57 PM |
Creating Records in tables automatically | peterg290935 | Using Forms | 8 | June 22nd, 2005 08:12 AM |
Need Help In Printing Current Record in Specific Report | RNUSZ@OKDPS | Setting Up & Running Reports | 1 | May 16th, 2005 09:06 PM |
Procedure run (Access open / Close) | Niklas Östergren | General Discussion | 9 | December 29th, 2004 02:02 PM |