Thanks for that TheDocMan.
I guessed that as a hacker wouldn't know form, or field names, they couldn't read a value. But they are an ingenious and persistent bunch.
Dim f As Variant
Dim Cs As Variant
For Each f In CurrentProject.AllForms
Debug.Print f.Name, f.IsLoaded
On Error Resume Next
For Each Cs In Forms(f.Name).Controls
Debug.Print f.Name, Cs.ControlSource, Cs.Value
Next
Next
Sub test_it()
Dim oAcc As Access.Application
Dim f As Variant
Dim Cs As Variant
Set oAcc = GetObject("X:\AnyWhere\Your.accde") ' access to open application, no hack
With oAcc
For Each f In .CurrentProject.AllForms
Debug.Print f.Name, f.IsLoaded
On Error Resume Next
For Each Cs In f.Controls
Debug.Print f.Name, Cs.ControlSource, Cs.Value
Next
Next
End With
End Sub
because I'm at work , in a hurry, and just looking to see if you could get the values on a hidden form.@moke123
In your code from post #5, why did you define f and Cs as variants rather than Access.Form and Control respectively?
To do something like this, you need a triggering event.Code:If Application.UserControl = False Then Application.Quit
The test procedure above does not touch on such an event.
Ha! Jealousy will get you nowhere!because I'm at work , in a hurry, and just looking to see if you could get the values on a hidden form.
we're not all retired ya know.![]()
... on an open DB?Just tested the code ...
Private Sub Form_Load()
If Application.UserControl Then
MsgBox "This application cannot be opened directly", vbCritical, "Critical Error"
Application.Quit
End If
cmdQuit.SetFocus
End Sub