reference and count subreport objects

  • Thread starter backToASP via AccessMonster.com
  • Start date
B

backToASP via AccessMonster.com

I have a process that allows the user to duplicate 'stock' reports as user-
defined reports. But, I need to be able (in VBA) to check the selected
report to see if there are any subreport objects, duplicate and rename those,
then duplicate and rename the main report and change the subreport
sourceobjects to the newly named subreports. The problem - I'm not sure how
to count and/or get the names of any subreport objects for the report (it is
opened in design view and hidden from the user for this process). Any
suggestions appreciated. JLG
 
G

GolferGuy

ControlType is the word that will help you here. Look at this code to see
how you can use this in a loop to count all the subreport controls on a
report:
Dim ctl As Control
For Each ctl In Me.Controls
If (ctl.ControlType = acTextBox) Then
' Your code would go here
End If
Next ctl
For more explaination, try this link:
http://www.tek-tips.com/faqs.cfm?fid=5010
 

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