Web Development



How to retrieve form properties with vba

By pm.waridel ·
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")
' 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![form_name] = .Name
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 conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Just clarify for me

by LarryD4 In reply to How to retrieve form prop ...

If I read this right, you have a database you created in Access and then you have another Access database that just contains connecting forms to the main database. And you want to write some VBA in the main database, that will get information from the external form.

Is that correct?

Related Discussions

Related Forums