473,320 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Counting SubForms and SubReports

Hi,

As means for boosting performance of an inherited Access97 database, I
would like to identify, count and reduce the subform and subreport
controls. Is there a programatic way of listing these controls?

Thanks for your help.

Henry

Nov 13 '05 #1
1 1268
Function ListSubs()
Dim db As Database
Dim con As Container
Dim doc As Document
Dim frm As Form
Dim ctl As Control
Dim strRetVal As String

Set db = CurrentDb
Set con = db.Containers("Forms")

For Each doc In con.Documents
DoCmd.OpenForm doc.Name, acDesign
Set frm = Forms(doc.Name)
For Each ctl In frm.Controls
If ctl.ControlType = acSubform Then
If Len(strRetVal) = 0 Then
strRetVal = frm.Name & ": " & ctl.Name
Else
strRetVal = strRetVal & vbCrLf & frm.Name & ": " &
ctl.Name
End If
End If
Next
DoCmd.Close acForm, doc.Name
Next
ListSubs = strRetVal

db.Close
Set db = Nothing

End Function

Paste into new module and call from the debug window: ? ListSubs()

I'll let you figure out how to modify this function to return the same
thing from the reports collection.

Cheers.

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: MARK TURNER | last post by:
Hi all, I have 2 tables in a one to many relationship. The first table is customer's info. Second table is customer's assets. I have an autonumber field in the customer's table which I use for a...
1
by: Anne | last post by:
I have a report containing multiple subreports (approximately 37 subreports) that are based on individual queries. The query calls to only display the subreport if there is valid data in the table...
1
by: Don Sealer | last post by:
I have a report that includes 5 different subreports. I'd like to be able to open this report using a date function (Start Date and End Date). I'd like all five subreports to show the data from...
0
by: Don Sealer | last post by:
I have a report that includes 5 different subreports. I'd like to be able to open this report using a date function (Start Date and End Date). I'd like all five subreports to show the data from...
3
by: lesperancer | last post by:
I've got the following tables tblMaster masterID etc tblDetail masterId detailId etc
0
by: sundowner225 | last post by:
Could someone help me with an output problem? I have an access database that I need to create some xls output from. Basically, I have three tables: Faculty_Table: Fields=ID,Name, Type,...
1
by: natwong | last post by:
Hi All, I'm hoping that someone could help me out since I'm new with Access. Background: Database was set up as a simple data entry and reporting tool for Program Initiatives. The data...
10
convexcube
by: convexcube | last post by:
Hi everyone, This is just a little rundown of a problem I discovered & the solution I found: I have a report which runs off a query (query1). Within the report there are also 2 subreports which...
6
by: Brett Barry: Go Get Geek! | last post by:
Hello, I have a main report with a Record Source, a DateToday table, that has the current Month and Year. I have about 60 queries, each pulling different data via ODBC, that I am creating...
10
by: glenfernandez | last post by:
HI there, Need a little help with the reporting component of my MS Access 2002 project and would appreciate any insight / help from the experts. Please bear with me as I am still learning Access...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.