[AccessD] How do I list all forms in an ADP (no MSysObjects)

Susan Harkins harkins at iglou.com
Mon Mar 31 19:55:19 CST 2003


Dim frm As Form
Dim ctl As ComboBox
Dim strObject As String
Dim strList As String
Dim aob As AccessObject
Dim obj As Object

Set frm = formname
Set ctl = comboboxname
strObject = ctl.ListIndex
Set obj = CurrentData.AllForms

On Error Resume Next
For Each aob In obj
 strList = aob & ";" & strList
Next
ctl.RowSource = strList

should list the forms in a combo box -- but it won't be sorted in any
particular order -- and I'm not sure about that strList statement -- had
margueritas for supper. :)

Ah crap - -you're using 97 -- I don't think this will work in 97 -- AllForms
is new to 2000 isn't it? In that case, try

Dim db As DAO.Database
Dim cnt As DAO.Container
Dim doc As DAO.Document
Dim strTemp as String
Dim strList As STring

Set db = CurrentDB
Set cnt = db.Containers!Forms
For Each doc In cnt.Documents
   strTemp = doc.Name & ";" & strTemp
Next
combobox.RowSource = strList


Susan H.



> In an Access 97 MDB, I can use the following SQL statement to list all
forms
> in an MDB:
>
> SELECT MSysobjects.Name
> FROM MSysobjects
> WHERE (((MSysobjects.Type)= -32768))
> ORDER BY MSysobjects.Name;
>
> I know there are no local tables in an ADP, but somehow, somewhere, Access
> must be keeping this information. Is there an equivalent way of doing the
> same (either SQL or VBA) in an ADP?
>
>
> TIA
>
> David McAfee
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>



More information about the AccessD mailing list