|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
returning 2 reports from one form
Hi All!
Is it possible to have two reports and be fit to call them from the one form. I have created two reports, 1 with detailed info and 2 with just totals. (but the latter is not linked up to the form used for calling up the first report.) The thing is, on my form I can select data by employee and by all employee. which will return info on an individual level and info on all employees But now I want to select All employees and return a different Report, one with the totals. The one mentioned above 2 I don't know if I can do this! but below I have pasted the VB code to give you a better understanding of what I am talking about. I.e. I want to select by individual and get report1 and also I want to select All and retrieve a different report.(2) VB CODE Option Compare Database Option Explicit Private Sub BeginDate_AfterUpdate() Me!EndDate = Me!BeginDate Me!EndDate.SetFocus End Sub Private Sub cboEmployeeName_AfterUpdate() If Me!cboEmployeeName = "*" Then Me!chkAllEmployee = True Else Me!chkAllEmployee = False End If End Sub Private Sub chkAllEmployee_AfterUpdate() If Me!chkAllEmployee Then Me!cboEmployeeName = "*" Else Me!cboEmployeeName = Null Me!cboEmployeeName.SetFocus End If End Sub Private Sub chkAllDates_AfterUpdate() If Me!chkAllDates Then Me!BeginDate = DMin("DateWorked", "[Time Card Hours]") Me!EndDate = DMax("DateWorked", "[Time Card Hours]") Else Me!BeginDate = Null Me!EndDate = Null Me!BeginDate.SetFocus End If End Sub Private Sub cmdPreview_Click() DoCmd.OpenReport "IMMREPORTALL", acViewPreview End Sub Private Sub Form_Activate() DoCmd.Restore End Sub Private Sub Form_Load() Me!BeginDate = DMin("DateWorked", "[Time Card Hours]") Me!EndDate = DMax("DateWorked", "[Time Card Hours]") End Sub Private Sub cmdClose_Click() On Error GoTo Err_cmdClose_Click DoCmd.Close Exit_cmdClose_Click: Exit Sub Err_cmdClose_Click: MsgBox Err.Description Resume Exit_cmdClose_Click End Sub I hope some one can help Kindest Regards Cillies |
|
#2
|
||||
|
||||
|
There are so many ways to do open any number of reports based on the criteria selection in the form or all criteria text box set to default value and select a summary report directly.
One simple method is you can Place a frame object (Radio button) with multiple report options 1.Detail 2.Summary 3.etc etc and based on the framevalue open different reports on cmdpreview button click event select case me!framename case is = 1 docmd.openreport "detail...." case is = 2 docmd.openreport "summary...." case else end select
__________________
V.Subramanian |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > returning 2 reports from one form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|