Solved Change SubForm SourceObject to Report (1 Viewer)

Extra_Cover

Registered User.
Local time
Today, 14:48
Joined
Oct 21, 2008
Messages
71
I would like to change the source object of a subform to a report. I have tried the following, which works when using forms.

Code:
        stDocName = "Rpt_DOI_Summary"
        Forms!Frm_MainMenu.SubFrmOption.SourceObject = stDocName
        Forms!Frm_MainMenu.SubFrmOption.SetFocus

I get the following error 'The settings you entered isn't valid for this property'

Does anyone know if this is possible?
 

Ranman256

Well-known member
Local time
Today, 09:48
Joined
Apr 9, 2015
Messages
4,338
dont put Reports in subforms. Put subForms in forms. (and subReports in Reports)

stDocName = "FRM_DOI_Summary"

Just Open a report.
 

Minty

AWF VIP
Local time
Today, 14:48
Joined
Jul 26, 2013
Messages
10,387
Yes, you can put a report in a form.
It is a good way of displaying data where you want the display to be able to expand with the amount of text.
Great for continuous forms where you don't need to edit the data.

The source object needs to be referred to including the reference to the report object;

SourceObject = "Report.Rpt_DOI_Summary"
 
Last edited:

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 14:48
Joined
Jul 9, 2003
Messages
16,426
The source object needs to be referred to including the reference to the report object;

SourceObjet = "Report.Rpt_DOI_Summary"


I didn't know this! Thank you!
 

isladogs

MVP / VIP
Local time
Today, 14:48
Joined
Jan 14, 2017
Messages
18,299
Although I don't often do so, you can also use a form as a subreport.
One reason for doing this is that disconnected ADO recordsets can be used in forms but not in reports.

However, when using forms in reports and vice versa, the functionality will not the same as when those objects are used 'normally'
 

Extra_Cover

Registered User.
Local time
Today, 14:48
Joined
Oct 21, 2008
Messages
71
Yes, you can put a report in a form.
It is a good way of displaying data where you want the display to be able to expand with the amount of text.
Great for continuous forms where you don't need to edit the data.

The source object needs to be referred to including the reference to the report object;

SourceObject = "Report.Rpt_DOI_Summary"
Many thanks. This is exactly what i want to do.
 

Users who are viewing this thread

Top Bottom