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
|
|||
|
|||
Selecting which subreports to include in a report
I have created a data-entry database. The users will enter data
into the form that the database opens with. They will enter data into the primary form (top part of the screen) and into 26 subforms which are located on tabs under the primary report. On EACH of the 26 subreports (tabs), the user must select one or both of two check boxes: “Dashboard Measures” or “Onsite Review.” In the final report, I need the Dashboard subreport (A) visible if the “Dashboard Measure” box was checked on that tab; if “Onsite Review” box is checked, then the Onsite Review subreport (B) should be visible in the report; and if both boxes are checked on the form, then both subreports should be visible in the report. Currently I have both subreports added to the report, but I can’t figure out how to tell them when to be visible and when to be hidden. Perhaps it would help if I give you the following example: Name of Report: Final1-Safety1 Name of SubReportA: R-05-Dash Name of SubReport B: R-05-Onsite Name of Form: F-05-FCReEntries Name of Box A: DashboardMeasures Name of Box B: OnSiteReview I appreciate any assistance you can provide, Signature Martha -- Martha Message posted via http://www.accessmonster.com |
#2
|
|||
|
|||
Selecting which subreports to include in a report
Hi Martha
First make sure the can shrink box is ticked for each subreport. On the form open event put in two lines. If Form![F-05-FCReEntries].DashboardMeasures = True then Me.[R-05-Dash].Visible = True Else Me.[R-05-Dash].Visible = False End If If Form![F-05-FCReEntries].OnSiteReview = True then Me.[R-05-Onsite].Visible = True Else Me.[R-05-Onsite].Visible = False End If Neville Turbit www.projectperfect.com.au "Martha Fulton via AccessMonster.com" wrote: I have created a data-entry database. The users will enter data into the form that the database opens with. They will enter data into the primary form (top part of the screen) and into 26 subforms which are located on tabs under the primary report. On EACH of the 26 subreports (tabs), the user must select one or both of two check boxes: “Dashboard Measures” or “Onsite Review.” In the final report, I need the Dashboard subreport (A) visible if the “Dashboard Measure” box was checked on that tab; if “Onsite Review” box is checked, then the Onsite Review subreport (B) should be visible in the report; and if both boxes are checked on the form, then both subreports should be visible in the report. Currently I have both subreports added to the report, but I can’t figure out how to tell them when to be visible and when to be hidden. Perhaps it would help if I give you the following example: Name of Report: Final1-Safety1 Name of SubReportA: R-05-Dash Name of SubReport B: R-05-Onsite Name of Form: F-05-FCReEntries Name of Box A: DashboardMeasures Name of Box B: OnSiteReview I appreciate any assistance you can provide, Signature Martha -- Martha Message posted via http://www.accessmonster.com |
#3
|
|||
|
|||
Selecting which subreports to include in a report
Hi, NevilleT,
Thank you for your response. I do have the shrink box ticked on the subreport, but I'm having trouble with the rest. Do I put the 2 lines on open event in the report or in the form? Your response says form, but that confuses me, because the form is where the user will first enter data into the subform and then will check the "DashboardMeasures" box and/or the "OnSiteReview" box. My next problem is that I'm getting error messages. I've double checked to make sure the form names, report names, and field names are entered correctly, but I'm still getting the same messages: -When I put the expression in the form (like you say), ------and I try to open the subform, I get an error message saying "Run-time error 2465: Microsoft Office Access can't find the field [F-05-FCReEntries] referred to in your expression"--when I hit "debug" it highlights the first line "If...then" ------and I try to open the report, I still get both subreports showing up in my report, instead of just the one that was checked on the subform. -When I put the expression in the report, I get an error message saying "Run- time error 424: object required"--when I hit "debug", it highlights the first line "If....then" So...I'm not doing something right somewhere. Have I given you enough information to figure out what I'm doing wrong? Thank you, Martha NevilleT wrote: Hi Martha First make sure the can shrink box is ticked for each subreport. On the form open event put in two lines. If Form![F-05-FCReEntries].DashboardMeasures = True then Me.[R-05-Dash].Visible = True Else Me.[R-05-Dash].Visible = False End If If Form![F-05-FCReEntries].OnSiteReview = True then Me.[R-05-Onsite].Visible = True Else Me.[R-05-Onsite].Visible = False End If Neville Turbit www.projectperfect.com.au I have created a data-entry database. The users will enter data into the form that the database opens with. They will enter data into the [quoted text clipped - 27 lines] Martha -- Martha Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...ports/200907/1 |
#4
|
|||
|
|||
Selecting which subreports to include in a report
Hi, NevilleT,
Thank you for your response. I do have the shrink box ticked on the subreport, but I'm having trouble with the rest. Do I put the 2 lines on open event in the report or in the form? Your response says form, but that confuses me, because the form is where the user will first enter data into the subform and then will check the "DashboardMeasures" box and/or the "OnSiteReview" box. My next problem is that I'm getting error messages. I've double checked to make sure the form names, report names, and field names are entered correctly, but I'm still getting the same messages: -When I put the expression in the form (like you say), ------and I try to open the subform, I get an error message saying "Run-time error 2465: Microsoft Office Access can't find the field [F-05-FCReEntries] referred to in your expression"--when I hit "debug" it highlights the first line "If...then" ------and I try to open the report, I still get both subreports showing up in my report, instead of just the one that was checked on the subform. -When I put the expression in the report, I get an error message saying "Run- time error 424: object required"--when I hit "debug", it highlights the first line "If....then" So...I'm not doing something right somewhere. Have I given you enough information to figure out what I'm doing wrong? Thank you, Martha NevilleT wrote: Hi Martha First make sure the can shrink box is ticked for each subreport. On the form open event put in two lines. If Form![F-05-FCReEntries].DashboardMeasures = True then Me.[R-05-Dash].Visible = True Else Me.[R-05-Dash].Visible = False End If If Form![F-05-FCReEntries].OnSiteReview = True then Me.[R-05-Onsite].Visible = True Else Me.[R-05-Onsite].Visible = False End If Neville Turbit www.projectperfect.com.au I have created a data-entry database. The users will enter data into the form that the database opens with. They will enter data into the [quoted text clipped - 27 lines] Martha -- Martha Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...ports/200907/1 |
#5
|
|||
|
|||
Selecting which subreports to include in a report
Hi Martha
Sorry. Meant the open event of the report. It seems that the program cannot find the checkbox on the form. There are a couple of debugging tricks you can use here. Before the line causing the error, put in a messagebox to see if a value is available. Something like msgbox "Checkbox value is " & Forms!F-05-FCReEntries.DashboardMeasures if it errors, you need to work out why the checkbox is not available. You can also see the value by hovering over the field name in the code using debug, but sometimes it is easier to use a messagebox. - It may be because the form has been closed first; - It may be the checkbox is null. If that is the case you can use nz(Forms!F-05-FCReEntries.DashboardMeasures , 0) to default to a false vale. - If you are still getting an error, you can use the build function to create the address for you. One easy way is to put a text box on your report and right click the control source field Right click and select build. Use the build function to get the correct syntax for the checkbox. Copy and past the object description into the code and try again. You can then delete the textbox. Hope that works for you. Neville Turbit www.projectperfect.com.au "MarthaF via AccessMonster.com" wrote: Hi, NevilleT, Thank you for your response. I do have the shrink box ticked on the subreport, but I'm having trouble with the rest. Do I put the 2 lines on open event in the report or in the form? Your response says form, but that confuses me, because the form is where the user will first enter data into the subform and then will check the "DashboardMeasures" box and/or the "OnSiteReview" box. My next problem is that I'm getting error messages. I've double checked to make sure the form names, report names, and field names are entered correctly, but I'm still getting the same messages: -When I put the expression in the form (like you say), ------and I try to open the subform, I get an error message saying "Run-time error 2465: Microsoft Office Access can't find the field [F-05-FCReEntries] referred to in your expression"--when I hit "debug" it highlights the first line "If...then" ------and I try to open the report, I still get both subreports showing up in my report, instead of just the one that was checked on the subform. -When I put the expression in the report, I get an error message saying "Run- time error 424: object required"--when I hit "debug", it highlights the first line "If....then" So...I'm not doing something right somewhere. Have I given you enough information to figure out what I'm doing wrong? Thank you, Martha NevilleT wrote: Hi Martha First make sure the can shrink box is ticked for each subreport. On the form open event put in two lines. If Form![F-05-FCReEntries].DashboardMeasures = True then Me.[R-05-Dash].Visible = True Else Me.[R-05-Dash].Visible = False End If If Form![F-05-FCReEntries].OnSiteReview = True then Me.[R-05-Onsite].Visible = True Else Me.[R-05-Onsite].Visible = False End If Neville Turbit www.projectperfect.com.au I have created a data-entry database. The users will enter data into the form that the database opens with. They will enter data into the [quoted text clipped - 27 lines] Martha -- Martha Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...ports/200907/1 |
Thread Tools | |
Display Modes | |
|
|