Examine source code through ODBC, DAO or ADO

R

Richard

Is it possible to examine/extract the code behind a form using ODBC,
DAO or ADO ?

Any suggest links to reference material is appreciated.

Richard
 
D

Douglas J. Steele

ODBC, DAO and ADO are only intended to get at data.

To look at the code associated with a form using VBA, try something like:

Sub SeeCode(NameOfForm As String)
On Error GoTo Err_SeeCode

Dim modCurr As Module
Dim strCode As String

DoCmd.OpenForm NameOfForm, acDesign, , , , acHidden
Set modCurr = Forms(NameOfForm).Module
strCode = modCurr.Lines(1, modCurr.CountOfLines)
Set modCurr = Nothing
DoCmd.Close acForm, NameOfForm, acSaveNo

Debug.Print strCode

End_SeeCode:
Exit Sub

Err_SeeCode:
MsgBox Err.Number & ": " & Err.Description
Resume End_SeeCode

End Sub
 
Top