How to retrieve form properties with vba - TechRepublic
Question
December 9, 2008 at 06:51 AM
pm.waridel

How to retrieve form properties with vba

by pm.waridel . Updated 17 years, 7 months ago

I’m using access 2003. I write an access base to document external access base. I don’t find how to retrieve the properties of an external access forms. Here is my code :

‘ ——————————————————————————————-
‘ Sub form_inventory
‘ – Inventaire des formulaires

Sub form_inventory()

Dim loc_dbs As Database
Dim loc_rcd As Recordset
Dim ext_dbs As Database
Dim ext_cont As Container
Dim i As Integer
Dim src As String

‘ Ouverture de la base externe
Set ext_dbs = DBEngine.OpenDatabase(pub_db_full)

‘ Vidage de la table locale
Call empty_table(nom_form)

‘ Ouverture de la table locale
Set loc_dbs = CurrentDb()
Set loc_rcd = loc_dbs.OpenRecordset(nom_form)

‘ Ouverture du container des formulaires
Set ext_cont = ext_dbs.Containers(“Forms”)
Stop
‘ Parcours du container, r?cup?ration et enregistrement des donn?es
For i = 0 To ext_cont.Documents.Count – 1
With ext_cont.Documents(i)
loc_rcd.AddNew
loc_rcd![form_name] = .Name
loc_rcd.Update
End With
Next i
End Sub ‘ form_inventory

To get the name of external forms is evident. I want to retrieve essentially the recordsource name (query, table or other like sql string)

Thank you very much for usefull information

Pierre-Marie Waridel

This discussion is locked

All Comments