Here's a routine to get the recordsource for each form in a database.
Code:
'---------------------------------------------------------------------------------------
' Procedure : getFormRecordSource
' Author : Jack
' Date : 29-12-2012
' Purpose : To get the recordsource of each form in the current access database
' Outputs formname and recordsource to the immediate window
'---------------------------------------------------------------------------------------
' Last Modified:
'
' Inputs: N/A
' Dependency: N/A
'--------------------------------------------------------------------------
'
Sub getFormRecordSource()
Dim afrm As AccessObject
Dim frm As Access.Form
10 On Error GoTo getFormRecordSource_Error
20 For Each afrm In CurrentProject.AllForms
30 If Not afrm.IsLoaded Then
40 DoCmd.OpenForm afrm.name, acDesign, , , , acHidden
50 Debug.Print afrm.name & " -- " & Forms(afrm.name).RecordSource
60 DoCmd.Close acForm, afrm.name
70 Else
80 Debug.Print afrm.name & " -- " & Forms(afrm.name).RecordSource
90 End If
100 Next afrm
110 On Error GoTo 0
120 Exit Sub
getFormRecordSource_Error:
130 MsgBox "Error " & Err.number & " (" & Err.Description & ") in procedure getFormRecordSource of Module AWF_Related"
End Sub
It may help. Not all forms have record sources.
My guess as to how it would be set up is along this line:
Code:
For each Form in the Database
For each Control on the Form
'you will need to deal with type of Control
get the controlsource or rowsource
write the Formname, ControlName and Rowsource/controlsource value to a table FormControlInfo
next control
next Form
Subsequently;
Code:
For each Table in the FormControlTable
Identify the Pks
Write Tablename, PrimaryKey (may be compound) to some final location
Next Table
Research Google 'identifying all controls on a form MS Access'
Some links
http://www.devhut.net/2010/12/05/ms-...ols-on-a-form/
http://stackoverflow.com/questions/3...n-a-subform-ac
But there are many more
Good luck with the project.
EDIT::::
Following the original post I found this link from Allen Browne which may be helpful
http://allenbrowne.com/ser-73.html