Solved Change sub report control source? (1 Viewer)

Gasman

Enthusiastic Amateur
Local time
Today, 16:36
Joined
Sep 21, 2011
Messages
14,044
Looking for some advice please.

In my recreation of the Bibby Gazette of the shipping company I served with, the Gazette format was as Picture A.

They then changed it to Picture B.

Currently the Report has 3 subreports
One for the Deck (on the left), one for the Engine Room (on the right) and one for others (in the middle below the other two.

Previously I just added those that would exist in previous reports, but would now like to add everything.

I know how to concatenate the data, just looking for some guidance on how to make the change from one format to another?

I can identify the change from the issue number where the extra data starts, issue 44.
For now, just for testing I have created another report with a simple edit to see if the report at least is loaded.

I have tried the following code in the load event of the report

Code:
Private Sub Report_Load()
' Change report layout for 44 onwards.
If Me.txtIssue > 43 Then
    Me.srcRest_By_Ship.SourceObject = "rptRest_By_Ship"
End If
End Sub

but get the Report error picture? :(

So where can I implement the check please? or is there a better way

Edit: I tried the Open event, although I expected the data not to be available :), but got Open report cancelled message.
 

Attachments

  • PictureA.jpg
    PictureA.jpg
    62.8 KB · Views: 193
  • PictureB.jpg
    PictureB.jpg
    78.8 KB · Views: 198
  • report error.PNG
    report error.PNG
    14 KB · Views: 193
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 16:36
Joined
Sep 21, 2011
Messages
14,044
Paul,
I don't have an answer, but I did find this similar situation via google. It may offer some insight.
Thanks Jack, I did Google (practice what you preach Paul :) ), but could not find anything, well as of yet. Normally I find it just after I have posted a question. :(
The data is not available in the Open report, and as mentioned in my Edit, the report would not even open when I tried in that event. :(
 

Gasman

Enthusiastic Amateur
Local time
Today, 16:36
Joined
Sep 21, 2011
Messages
14,044
Jack,
It is not the recordsource I am trying to change, but the source object for the subreport control.
My thoughts are to show a different report in the subreport control?

I still have to work on the construction of that report as I need
Rank: Lots of names, Rank: lots of names

Might have to live with
Rank: Lots of names
Rank: Lots of names
Rank: Lots of names
if I cannot emulate the Gazette exactly.

Edit: Just found this https://social.msdn.microsoft.com/F...subreport-sourceobject-in-vba?forum=accessdev which infers only on Open, so I will likely need to pass something in OpenArgs to test on, as data not available on Open. :(
 

Gasman

Enthusiastic Amateur
Local time
Today, 16:36
Joined
Sep 21, 2011
Messages
14,044
Got it done with OpenArgs.
Now on to how to construct the actual report. :(

Seems my problem on Open, was I just changed the _Load() to _Open().
Access showed the code to move to the Open event in the properties window, but gave that error.?
So I copied and deleted the code, then opened the event via the properties window and pasted the code back in. Breakpoint and stepping through the code shows that as working. (y)
 

jdraw

Super Moderator
Staff member
Local time
Today, 12:36
Joined
Jan 23, 2006
Messages
15,364
Got it done with OpenArgs.
Glad you found a solution.
 

Users who are viewing this thread

Top Bottom