Well the first bit is easy - to get all the form names in a query;
Code:
SELECT MSysObjects.Name, MSysObjects.Type, MSysObjects.Flags, MSysObjects.ForeignName, *FROM MSysObjects
WHERE (((MSysObjects.Type)=-32768)) and [Name] Like "*-detail*"
Then you need to get a bit clever - I'm not sure you can get the forms width without it being open... (happy to be proved wrong just haven't had time to investigate)
So you will need to open the form in design view, (to prevent any code running) check the property then close it.
Code:
Option Compare Database
Option Explicit
Sub GetFormWidths()
Dim rs As Recordset
Dim sSql As String
Dim iWidth As Long ' the width will be reported in twips - I'll let you work that out in inches.
Dim sForm As String
' open a recordset with the form names - change the criteria appropriately
sSql = "SELECT MSysObjects.Name, MSysObjects.Type, MSysObjects.Flags, MSysObjects.ForeignName"
sSql = sSql & " FROM MSysObjects WHERE (((MSysObjects.Type) = -32768)) and [Name] Like " *-Detail* ""
Set rs = CurrentDb.OpenRecordset(sSql, dbOpenSnapshot)
rs.MoveFirst
While Not rs.EOF Or rs.BOF
sForm = (rs.Fields("name"))
DoCmd.OpenForm sForm, acDesign, , , acFormPropertySettings, acHidden
iWidth = Forms(sForm).Width
DoCmd.Close acForm, sForm
Debug.Print rs.Fields("name"), iWidth
rs.MoveNext
Wend
End Sub
This will list all the forms and their widths in twips, in the immediate window - hopefully you can work out the rest?
Example from the immediate window of a small sample database;
Code:
GetFormWidth
sfrmDetailLookUp 13656
sfrmFullDetails 13164
sfrmRepairList 13296