Forms :: Using Same Subreport But With Different Queries
Jun 15, 2014
I am creating an end of week report, which needs information from Sat-Fri, so basically it will be one sub form, but used 6 times.
I'd prefer not to have to make 6 subforms, with 6 queries, but rather using 1 subform and 1 query 6 times.
For example, on the parent form, I will add the subforms, and name them "Sat", "Mon", "Tue" etc...
I want to make one query that filters the information based on the name of the subform:
Day: Format([Date],"ddd")
Where: Day = Me.Name
I can't figure out what to ask the query to refer to, to retrieve the name of the subform it's currently sat in.
View Replies
ADVERTISEMENT
Oct 6, 2004
I have a report with the same subreport appearing twice. The two instances of this subreport have different queries.
For instance boys and girls information. The only difference is the queries (one would have sex=M the other sex = F)
Is there any way of doing this without copying the subreport and giving it another name (this of course would allow me to assign different queries to each subreport).
Thanks
View 3 Replies
View Related
Jun 10, 2015
Ok so I want to generate a subreport for my deacons that show what families have been assigned to them.
Using the wizard I created a subreport that pulls the name & phone number(s) for each member with the same family ID, and Deacon ID (which pulls the name, number and FID from the member table, then checks the family table and gets the deacon ID). My question is, how do I tell the report to check if the current member I'm looking at is a deacon and if so use their deacon number as the reference number for "Deacon ID"?
I have a table for my deacons that links the member through their EnvNum (if they're a Deacon). Not sure if I'll need that table for this, but thought I'd mention I do have one.
View 2 Replies
View Related
Jun 10, 2013
I have a main form (ZooMobile Booking Form-New Client) with a subform (ZooMobile Event Booking-New Client) within it. In the main form I have a button to open up a report displaying the main form's current record.
The report that is opened has a subreport that needs to display the current record from the subform.
So far I've managed to get the report to open to the main form's record using the following On_click command:
DoCmd.OpenReport "ZooMobile Billing Invoice", acViewPreview, , "[Client_ID]=Forms![ZooMobile Booking Form-New Client].CustIDTxt"
I can't manage to get the subreport to open to the current record in the subform, however. I've tried to integrate it into the above event and to use On_load events in the report and subreport but everything either comes up as a bug or has no effect on the subreport's record.
View 4 Replies
View Related
Jul 16, 2015
I have a main form with a subreport.
Mainform width is 22"(Maximum)
Subreport Wdth is also 22" (Maximum)
When i run the mainform, the subreport shows correctly but the vertical scrollbar is at most right side of main form so i have to scroll main form horizontally first to access the vertical scroll bar of subreport.
To solve, changing subreport orientation to right-to-left shows vertical scroll bar at most left but still if i scroll horizontally on mainform, that scrollbar hides as its not freezed.
Consider ActiveX Control of Microsoft ScrollBars 2.0 .....
View 14 Replies
View Related
Jul 4, 2014
I have a form with a tabbed control on it. The tabbed control has 4 tabs that each have a report on them. When I select a company name on the main form, I requery these 4 reports to show data related to that company.
For some strange reason, 2 of my reports requery with no problem, and 2 of them give me a message that the report can't be found. Here is the code:
Code:
Private Sub cboCompanyName_AfterUpdate()
On Error GoTo cboCompanyName_AfterUpdate_Err
' DoCmd.SearchForRecord , "", acFirst, "[CompanyID] = " & str(Nz(Screen.ActiveControl, 0))
' After selecting a company, requery the subreports to display the appropriate data
' These 2 work
Forms!frmCompanyHistory!RptCompany_Projects_Brief.Requery
Forms!frmCompanyHistory!RptEmployeesSpecificCompany.Requery
'These 2 Fail
Forms!frmCompanyHistory!SubRptCompany_Payback.Requery
Forms!frmCompanyHistory!SubRptCompany_Revenue.Requery
'Other things I've tried
'Forms!frmCompanyHistory!TabCtl66!SubRptCompany_Payback.Requery
'Me.TabCtl66!SubRptCompany_Revenue.Requery
As a side note, if I chose the company, say "ok" to the error, and then go run the queries that these reports are based on, I get the correct records. Also, if I chose the company and run the 2 failing reports standalone, they work fine, so I know the problem isn't the reports or the queries themselves.
I have also checked and rechecked for any spelling mistakes and have found none. I should mention that the error message is "Programs cannot find the field 'SubrptCompany_Payback' referred to in your expression".
View 8 Replies
View Related
Jun 16, 2006
I've created a database which I'm pretty much using as a point of sales terminal.. it does sales, returns, expenses etc. I have created a report for each one of these (sales, returns...) which can be printed off at the end of each day.
At the moment, if there is no data in one of the reports, I have put a bit of code in the NoData event of the report that will make a label visible saying "no sales/returns/expenses for this date".
I am trying to combine all of these reports into one report so the user can click a button to open a general "End of Day" report. The problem with making them all subreports is that if there is no data in a subreport, nothing will be displayed in that subreport.
Is there anyway to force access to display a subreport regardless of whether is has data in it? or can anyone see another option which i have missed?
View 3 Replies
View Related
Apr 6, 2006
Is there any way to add a dropdown box or something that determines that a subrecord is active/completed, and then have a way to jump straight to the one that is active by clicking a button on the record? In the example I attached, I want to be able to click on the button above the tab and have it switch to that tab and open the first record it finds that has "Active" selected.
View 1 Replies
View Related
Oct 28, 2004
i have a subreport on a header of one group and sometimes has data and sometimes hasnt.I would like that when subreport is empty it doesnt show subreport header but I dont know how.code Me!subreport.Visible = Me!subreport.Report.HasData
doesnt work properly since it always has data,just not on every page....
View 1 Replies
View Related
Dec 5, 2004
I have created a report and the subreport. The information from the subreport will not show up when I bring the report up. I created a query with the info needed for the subreport but know I'm missing linking something somewhere? Any help?
Thanks-
View 2 Replies
View Related
Aug 16, 2005
I'm new to access, I've done database work before just not with this package, I have only one small problem and this should be an easy one...
Without going into too much detail, i have a report that generates a list and calculates a few totals based on a date range inputed by a user. (I do this by using the "Between[Report Start Date] and [Report end Date]" statement as my criteria for the DATE field in my SQL statement.)
Inside that report i would like to include a subreport which summarizes the data of the main report. this subreport needs to display data based on the same date range as the main report. I simply cannot figure out how to get the subreport to use the same date range without prompting the user to type it in twice. I have another report that generates a subreport based on a users last name, this subreport works just fine ( I think this is because there is only one user inputted field and not two as with the date range.)
Both the subreport and the main report calculate the correct data when run independently, so I am confident they whole thing will work as soon as I know how to share the user inputted criteria.
If you have any answers please reply ASAP, it would be really appriciated.
View 1 Replies
View Related
Feb 6, 2006
Hi all!
I'm kinda stuck in a rut with one of my reports.
I have a loan database, and I need a detailed report with the borrower's name, repayment details according to their loan serial number. In the same report, I will also need details of all other people whom they have acted as guarantors for.
So what I have is a form for the user to select the person they would like to check on. Based on the user input, it generates a report with the borrower's details, as well as loan details. I then have a subreport which lists all repayments made based on the loan serial number, which works fine.
I'm stuck, however in trying to create another subreport in the main report to generate all details pertaining to loans which the person has acted as a guarantor. I tried linking the Guarantor's name to the form for the input, but in doing this, I get the guarantor's details, but my loan repayment subreport returns a blank.
Any suggestions or ideas, please?
It will be greatly appreciated! Been stuck with this for a few days now.
Thanks again!
View 11 Replies
View Related
Mar 21, 2006
I have a report open that contains a subreport. I am trying to run the following code from a form to change the filter on this subreport.
Reports("rptStaffDetail").Controls("rptStaffReportSub").Report.Filter = "MasterCourseType = 1"
I get the error 'The setting you entered isn't valid for this property'
I should be able to access the subreport this way as the following code ran from the form works fine.
Reports("rptStaffDetail").Controls("rptStaffReportSub").visible = False
View 2 Replies
View Related
Jun 15, 2005
I have a Report linked with a SubReport. I would like to cancel viewing this Report if my SubReport Has No Data.
i tried this code but the report just shows up. Any Ideas?
Private Sub Report_Open(Cancel As Integer)
On Error GoTo Err_Trapper
If Reports![qryRepCurOrgProjsSR].Report.HasData = 0 Then
Cancel = True
End If
Err_Trapper:
MsgBox Err.Description
Exit Sub
End Sub
Ok i got an error message. Yoy entered an expression that has an invalid Reference to the hasData property.
Ive tried using a text bpx on my main report and putting a control source as
=IIf(qryRepCurOrgProjsSR.Report.HasData,0,"Nothing")
Then in my Report Open Event i put the code below. But it fails me still.
If trim(Me.MyText) = "Nothing" Then
MsgBox "The Report Is Cancelling....."
Cancel = True
Exit Sub
End If
View 3 Replies
View Related
Jun 8, 2006
I tried looking through the threads to find something that is relevant to my situation.
I am having trouble with a form where i need to select a name in one combobox and a month in another and then upon which a subreport displays the records for that name and month on a subreport which can then be added extra records or old records edited.
Does anyone know how to do this or can maybe just give me some code or point of reference to do this. I have tried but all attempts return no results.
Any help is much appreciated. Thx
Frans
View 1 Replies
View Related
Nov 25, 2004
I am trying to do a simply calculation on a report which uses a value from a subreport. The main report is called rptAllProjectsStatus the sub report is called rptAllProjectsStatusExp, and the box from the sub-report is called tboAmount which is controlled by query.
In the main report I have a box whose control source is
=[tboFixedFee]-[tboSumStaffingCost1]-rptAllProjectsStatus!rptAllProjectsStatusExp!tboAm ount
But it doesn't recognise this formula - what am I doing wrong?
I know the problem is with the latter part of the formula (in connection with the sub-report), as if I remove this part, the rest of the calculation works fine.
thanks
S
View 6 Replies
View Related
Oct 22, 2007
I have page numbers in a subreport. How do I get them to update to match the correct page numbers for the report?
Thank you.
View 2 Replies
View Related
Jun 20, 2014
So I am adding a chart (on a subreport) to a report that has multiple subreports already. I have gotten the chart to show up correctly on the report, but now 2 of my other subreports are not working. I am being prompted to input parameters for these subreports that used to pull their parameters (between dates) from the main report.
I read somewhere that charts master/child linking doesn't work but I'm not sure if that applies to subreports with charts on them, or just charts in general. I've tried changing the query on the chart subreport a little without luck. Is this likely some glitch thing? Should I keep trying to alter the query or maybe there is some other work around option?
View 7 Replies
View Related
Mar 5, 2006
I have a report named rpt100 with two subreports srpt100a and srpt100b. The subreports are based on query qry100a and qry100b. Both queries are based on tbl100. I removed a field named 'Comment' from tbl100, as it wasn't useful; Also removed the fieldname from both qry100a and qry100b. When opening rpt100 a parameter dialog opens asking for data on the deleted fieldname 'Comment'. The field 'Comment' was never used in the report or subreports.
Inspection of the subreport fieldlist shows field 'Comment' still present.
How, other than remaking the rpt100 and both srpt100a and srpt100b, do I remove the field 'Comment'?
Gunner...:confused:
View 1 Replies
View Related
Aug 26, 2004
I have a report that has an embedded subreport. The main report is grouped on client id. The aim is print a different client on a different page (I have the force new page after section set). The subreport is put into the section footer. The problem is that the subreport is based on a different query. How can I filter the subreport query result to show only the information for the client specified in the main report.
thanks
newbie
View 3 Replies
View Related
Oct 2, 2004
I haev a report with 15 sub reports. I have to use Visual Basic to format the sub reports. I know how to do the formatting (see below) but what I would like to do is have one function (Public) that I can pass the subReport name to and have the formatting happen. This would be mush easier to maintain than copying the code below into on_print events of all 15 sub reports.
Has anyone done this and have an example??
Thanks
--------------------------------------------------------------------------------------
Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer)
Dim widthOfBox, startLeftSide
startLeftSide = 0.017
widthOfBox = 0.21
Me.ScaleMode = 1
Me.ForeColor = 0
'Repeat the following line of code for each vertical line
' 1*1440 represents 1 inch
' Me.Line (0 * 1440, 0)-(0 * 1440, 14400) 'Draws line at Left Margin
Me.Line ((startLeftSide * 1440) + widthOfBox * 0 * 1440, 0)-((startLeftSide * 1440) + widthOfBox * 0 * 1440, 14400) 'Draws line at Left Margin
Me.Line ((startLeftSide * 1440) + widthOfBox * 1 * 1440, 0)-((startLeftSide * 1440) + widthOfBox * 1 * 1440, 14400) ' Draws next line
Me.Line ((startLeftSide * 1440) + widthOfBox * 2 * 1440, 0)-((startLeftSide * 1440) + widthOfBox * 2 * 1440, 14400) ' Draws next line
Me.Line ((startLeftSide * 1440) + widthOfBox * 3 * 1440, 0)-((startLeftSide * 1440) + widthOfBox * 3 * 1440, 14400) ' Draws next line
Me.Line ((startLeftSide * 1440) + widthOfBox * 4 * 1440, 0)-((startLeftSide * 1440) + widthOfBox * 4 * 1440, 14400) ' Draws next line
'the 14400 is an arbitrary number to increase the line to the max of a
'section.
End Sub
View 1 Replies
View Related
Dec 5, 2004
Ok I've browesed this forum and can't seem to find anything that will work.
I have a report that includes 7 subreports with a page break before each subreport.
I want to hide, or disable the page breaks and subreports if a give subreport is empty.
Any ideas on how to do this?
View 2 Replies
View Related
May 8, 2013
I have a main report with 3 sub reports.The Sub reports have onload events that fill up the text boxes with VBA code. When I open the sub report alone everything works fine. But when I open the main report, the on load of the subreport wont work.
View 1 Replies
View Related
Feb 12, 2014
I have a report with several subreports. I need to total the subreports onto the main report. How do I refer to the control on the subreport?I know that with a form / subform I would use: Me!Subform1.Form!Controlname.But simply replacing 'Form' with 'Report' doesn't seem to work.
View 1 Replies
View Related
Jun 16, 2014
I have a main report with several subreports. Some subreports have other nested subreports. all of the reports and subreports are based on queries. when a query returns no values, i would still like for the reports and subreports to display in print preview. (currently, they display in report view but not in print preview.)
I tried a few things:
1) I set all report section can shrink options to "No" - (this did not work)
2) I set the can shrink options for all textbox controls, within each report section , to "No" - (this did not work)
3) I moved all controls from the details section of the subreport to the report header section - (when I did this, I got the subreport to show in print preview when the query for a single subreport returns no values but when i have a subreport with nested subreports that have no value, none of them show up in print preview)
I've searched...moving the controls from the details to the report header was the best thing i could find, but again, this only works with a single subreport and not with multiple nested subreports.
View 8 Replies
View Related
Oct 21, 2013
I would like to create a report based on a query. The first part is simple enough. However within this query I have a 'Count field' (a total of the number of duplicated this record has appeared in the table). And would like to create a subreport (if possible) based on that value for example. if count > 1 then show subreport.
My question therefore; is the above possible? How would I go about linking this logic with the subreport
View 1 Replies
View Related