Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a new report to a form

Status
Not open for further replies.

Cillies

Technical User
Feb 7, 2003
112
GB
Hi All!

I have a report that I open by a form. I can pull details by individual and by all.

The report is fine when I pull by the individual as it displays all the information about that individual client. And the ALL function works fine to, its just I need to display the results in a different way from the individual display. It needs to be a break down of the results and just show totals for each client as oppossed to other details.


I'm not sure how to do this, I was thinking if I could put an extra button on the form which would pull a new form that I create, thus showing the information of all clients that I desire.

Or can I change the VB code (Which I am not very good at) to pull up a modified report displaying the required info.
Or Is it possible to add a control on a report, which would redirect me to the new report?

I am a bit lost here, so any help or advice would be very much appreciated

kindest Regards

Cillies
 
It sounds like you need to create two separate reports since you desire the display of the 'All' results to differ from the display of the 'Individual' results.

You don't say how you are calling the report from the form. If it's just a command button, then a simple solution would be to add another command button. Label one 'See All Results' and the other 'See Individual Results'.

If the user has already choosen either 'All' or 'Individual' to see the results on the form, you can capture that choice and use it to decide which report to open.


-Tracy
 
Well the thing is that I am using a Between date and Client search on a form with appropraite checkboxes for ALL Dates, Clients

So I able to select all clients over the min and max dates to retrieve info on all clients

I can also select a particular client between certain dates and retrieve that info.

Now what I want to be able to do is to select all clients on the form and bring up a different form, containing just the totals of the clients.

I am pretty sure that you can change the code to do this but I am not very competent At Visual Basic.

I have already done as you have said and created a seprate report returning the values That I want.

below I have posted the VB code to help illustrate what I am talking about.

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 "Team Utilization Billable Report", 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

Private Sub ALL_button_Click()
On Error GoTo Err_ALL_button_Click

Dim stDocName As String

stDocName = "Team Utilization Billable Report - All"
DoCmd.OpenReport stDocName, acPreview

Exit_ALL_button_Click:
Exit Sub

Err_ALL_button_Click:
MsgBox Err.Description
Resume Exit_ALL_button_Click

End Sub


This code works, I need to do be modified.

Kindest Regards
Cillies
 
I'm sorry, I'm not a VB expert either and I don't understand how or when the code you posted is being executed.

Also I'm confused that you originally asked for a method to display two different reports but are now asking about displaying the client sums in a form.

If you want to display sums in a form, then just create a subform and link it to your main form with the client id.

Perhaps someone else can interpret the VB you posted and offer suggestions.

-Tracy
 
Sorry Tracy, I ment Report and not form, but thanks very much for your time and consideration anyway.

Cillies
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top