reports collection referencing

B

Bill

In the code segment below, I'm attempting to reference
text-box controls on an open report from a general
module. The name of the report is passed to the general
module "RptName as String". I've tried several configurations
of the "With" statement, but so far nothing but runtime
errors pertaining to the "un-recognized" name of the
report.

What would be the correct syntax for such a reference?

Thanks,
Bill
==========================================

With Reports![RptName]!Controls

' Case Selection below attends to lines 1 and 2
Select Case FmtID
Case 1 'HOH & Spouse (with any Children on 2nd line)
!tbLn1 = HOH & " & " & Sp & " " & LastName

If Len(Ch) > 0 Then
!tbLn2 = Ch
Else
!tbLn2 = ""
End If
..
..
..
..
end with
 
B

Bill

Found it!

I over complicated things:

"With Reports(RptName)" works just fine.

and

Reports(RptName).Controls("tbLines" & I) works
when combining collections referencing.

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top