Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform reference from Module

Status
Not open for further replies.

mtompkins

IS-IT--Management
Jan 14, 2003
166
US
Ok gents - I've spent enough hours banging my head ...

I have a main form (frmMain) and a subform (frmReports) from which the user can select different reports to fire from a combo box (cboRptPicker) that sits on the subform.

When the button for generating the reports fires (also on the subform) it goes to a module that contains the following code:

Code:
rptNameStr = Forms!frmMain!frmReports!Forms.cboRptPicker.Value

The form(s) Main and Sub are open at the time this fires. The response is 'can't find the field frmReports refered to..'

I've also tried using this very helpful website for the different patterns (
however I'm at a loss.

Help is greatly appreciated.
 
rptNameStr = Forms!frmMain![frmReports control name].Form!cboRptPicker.Value

Have a look here:

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV - this is absolutely the issue at hand but I'm having difficulty navigating through it ..

Any chance I can have a helping hand?

The subreport is on a Tab control - which might be part of this math.

Thanks
 
Why not follow the expression builder (loaded forms ...)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
That did the trick - it was pulling the subreport control name.

Expression builder pulled it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top