J
Javier G via AccessMonster.com
Hi,
I have a problem to get infomation of ALL CONTROLS from all forms in a
external DB (Not linked)
My code is:
'********* START CODE ****************
Dim app As Object
Dim frm As Form
Dim ctl As Control
Dim strPathBD As String
Dim strPassword As String
Set app = CreateObject("Access.Application")
app.OpenCurrentDatabase strPathBD, False, strPassword
For Each frm In app.CurrentProject.AllForms
' MsgBox "FORM= " & frm.Name, vbExclamation
If Not CurrentProject.AllForms(frm.Name).IsLoaded Then
app.DoCmd.OpenForm frm.Name, acDesign, , , , acHidden
End If
For Each ctl In frm.Controls
MsgBox "FORM= " & frm.Name & vbCrLf & _
"CONTROL= " & ctl.Name & vbCrLf & _
"VALUE = " & ctl.Value & vbCrLf & _
"TYPE= " & ctl.ControlType
Next ctl
app.DoCmd.Close acForm, frm.Name, acSaveNo
Next frm
app.CloseCurrentDatabase
Set app = Nothing
MsgBox "FIN"
'******* FINNISH *************
Appreciate your help
Javier
I have a problem to get infomation of ALL CONTROLS from all forms in a
external DB (Not linked)
My code is:
'********* START CODE ****************
Dim app As Object
Dim frm As Form
Dim ctl As Control
Dim strPathBD As String
Dim strPassword As String
Set app = CreateObject("Access.Application")
app.OpenCurrentDatabase strPathBD, False, strPassword
For Each frm In app.CurrentProject.AllForms
' MsgBox "FORM= " & frm.Name, vbExclamation
If Not CurrentProject.AllForms(frm.Name).IsLoaded Then
app.DoCmd.OpenForm frm.Name, acDesign, , , , acHidden
End If
For Each ctl In frm.Controls
MsgBox "FORM= " & frm.Name & vbCrLf & _
"CONTROL= " & ctl.Name & vbCrLf & _
"VALUE = " & ctl.Value & vbCrLf & _
"TYPE= " & ctl.ControlType
Next ctl
app.DoCmd.Close acForm, frm.Name, acSaveNo
Next frm
app.CloseCurrentDatabase
Set app = Nothing
MsgBox "FIN"
'******* FINNISH *************
Appreciate your help
Javier