[SOLVED] Design change in subreport not showing in main report (1 Viewer)

Voltaire

New member
Local time
Today, 12:16
Joined
Jan 28, 2020
Messages
6
Greetings, All.
I will try not to sound stupid (I am stupid, I just don't want to sound like it ;)). I am required to mod an existing app in Access, but my background is limited, so...

In this app, there is a report, which has a subreport, which in turn has a sub-subreport. I successfully added a field to the main report and it works fine. I opened the sub-sub-report and added a field there, but though I saved it, when I run the main report, the change I made doesn't show in the sub-subreport. If I open the main report in Design View, I can see that the sub-subreport has the new field, and existing fields are moved, as I intended. When I run the main report, though, the new field is not visible and the existing fields are in their original locations.

I suspect I'm missing a simple step, but like I said, I'm stupid (though I don't want to sound stupid!). Any suggestions are most welcome.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 15:16
Joined
Feb 19, 2002
Messages
28,621
Sounds like you didn't change the subreport you thought you changed. Open the main form in design view and carefully check the control source of the subform control to ensure that you are changing the form you think you are changing. You also need to check the code in the main report to see if it is overriding the subreport during the report open or load event.
 

Voltaire

New member
Local time
Today, 12:16
Joined
Jan 28, 2020
Messages
6
Thanks for the reply, Pat. I went back to look again and test your theory.

When I open the main report in Design View, I can see the sub-subreport in question displayed, and it shows the changes I made. Further, when I select the sub-subreport and check the properties for the Source Object, it's listed as "Report.rptSOBOM subreport". There is a report named "rptSOBOM subreport", and when I open that report in Design View, it also shows the changes I made. I tried opening it from within the main report (in Design View) using the 'Open in a new window' technique, and it shows my changes there, too.

In short, any way I look at that sub-subreport in Design View, I see the changes, but when I actually run the main report, it shows the old, unchanged sub-subreport. It's as if it was saving a copy of the old one somewhere and refuses to use my modified one.

As I mentioned in the OP, the main report contains a subreport, which in turn contains a sub-subreport. It is this sub-subreport that I'm trying to modify. However, just for an experiment, I tried making an obvious visible change to the subreport (inside the main report, contains the sub-subreport) and it also has the same problem: my changes show up in Design View, but not when the report is run.

Sorry for the long post, but I'm completely stumped...
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:16
Joined
Sep 21, 2011
Messages
5,097
Can you upload the DB with enough data to view?
 

Voltaire

New member
Local time
Today, 12:16
Joined
Jan 28, 2020
Messages
6
Gasman, I don't think I can upload anything as yet, since I have only two (now 3) posts.

I'm not really sure what I would upload, though; the application uses Access for the client app and the actual live data resides in a SQL Server database. The mods I'm making are to the elements of the Access front end database, but there's no data to run the report with unless the SQL Server db is available as well. In addition, the licensing prevents the app from running unless connected to the specific SQL Server instance we are running.

Is there anything in particular you would look at in order to determine the issue? If you could describe what you would do if you had access to the system, perhaps I can take a look at it and report back.

My primary thought is that I am just doing something wrong (being quite inexperienced), and hopefully someone on the forum can point out what could cause a report to display a subreport without changes despite that subreport actually having been modified.
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:16
Joined
Sep 21, 2011
Messages
5,097
You could quickly make some local tables from the SQl Server tables? Anonymize it if need be.?
I suspect even empty tables would help?
I do not know if Jon has set the limits yet for file uploads, so you could just try and if that fails try zipping the DB.?

hard to help otherwise from what you have already described?,well for me at least. :unsure:
 

Voltaire

New member
Local time
Today, 12:16
Joined
Jan 28, 2020
Messages
6
To be honest, I really don't know how to go about that... Creating local dummy tables, then rewriting the queries that drive the report to the new tables, then adding dummy data, then wrapping it all up... If I was experienced enough to do that kind of thing, I probably wouldn't need to ask for help with something as basic as modifying a subreport. Just figuring out how to do it successfully would probably take more time than I've been given for this project.

I'll see if I can think of another way to provide more insight into my situation.
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:16
Joined
Sep 21, 2011
Messages
5,097
Fair enough.
I was thinking of a new DB with local tables the same structure as the SQL tables.? Perhaps we would not even need any data as it is the structure of the report we are dealing with?
Don't forget you can rename the tables as well. So you just create Table1 from Table, then renamethat to Table after deleting the link to the sql server tables.?

I realise it sounds like a lot of work which for you which to you is a small problem, but certainly it is hard for me to think what you are doing wrong.?
All I could suggest otherwise is possibly pics of all the relevant properties for each object and description of each.?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 15:16
Joined
Feb 19, 2002
Messages
28,621
Try opening the main report in design view and copying all the event code and pasting it here. Then do the same for the subform.

If the subform is in DS view, you can try opening the form in design view and then pressing the tab order so you can reset the tab order.
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:16
Joined
Sep 21, 2011
Messages
5,097
Pat,
These are all reports? :confused:
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 15:16
Joined
Feb 19, 2002
Messages
28,621
Reports can have event code. We're trying to find out if there is code or possibly a macro that runs when the report opens which substitutes a different subreport object. Sometimes people use a subform or subreport as a place holder but at runtime show something different. It may not be my choice but I have seen it done. In fact it caused me to waste hours debugging a problem similar to what you are describing. No matter how many times I changed this particular report, when it ran, it always reverted to the version prior to my changes.
 

Voltaire

New member
Local time
Today, 12:16
Joined
Jan 28, 2020
Messages
6
Reports can have event code. We're trying to find out if there is code or possibly a macro that runs when the report opens which substitutes a different subreport object. Sometimes people use a subform or subreport as a place holder but at runtime show something different. It may not be my choice but I have seen it done. In fact it caused me to waste hours debugging a problem similar to what you are describing. No matter how many times I changed this particular report, when it ran, it always reverted to the version prior to my changes.
Pat, you're a Genius!! This one reply not only solved my problem (there was in fact a different version of the subreport being called from within the Open event), but it also answered some other unasked questions I have about this project. Thanks for the education! How do I mark this as solved?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 15:16
Joined
Feb 19, 2002
Messages
28,621
--Pat, you're a Genius!! -- I like to think so ;) but the reality is that I have been doing development so long I've made my fair share of stupid mistakes as well as having to fix those made by others. My curse is that I remember them and in many cases also remember the solution. We got lucky with this one.

As to how to mark this solved, go back and look at your original post. Hopefully something will pop out.
 

Voltaire

New member
Local time
Today, 12:16
Joined
Jan 28, 2020
Messages
6
Well, I'm as dense about forums as I am about Access, but I did manage to modify the name of the thread. I was expecting some sort of "mark as answered" type of function... is it basically just adding [SOLVED] to the title, as I did?

Anyway, thanks to you and gasman for your time and assistance!
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:16
Joined
Sep 21, 2011
Messages
5,097
Well, I'm as dense about forums as I am about Access, but I did manage to modify the name of the thread. I was expecting some sort of "mark as answered" type of function... is it basically just adding [SOLVED] to the title, as I did?

Anyway, thanks to you and gasman for your time and assistance!
We do not appear to have one at the moment as we are using new software, so amending the Title is a good workaround if a little unweildy.
I've learnt from this thread as well. Thank you Pat.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom