Grab Field name

JayAndy

Registered User.
Local time
Today, 01:09
Joined
Jan 13, 2016
Messages
31
Hi

I have a Form with a Crosstab in there. Is it possible to use VBA to grab what is the active column (Field Name) is when you click in it.

Thanks
 
sorta,
you can program it to an F key, say F4 (it dont do much anyway)
Code:
   'set form KEYPREVIEW = YES
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF4 Then
  MsgBox Screen.ActiveControl.Properties("ControlSource").Value
End If
End Sub

you cant use a button, because as soon as you click it, the BUTTON becomes the object with the focus. So fkey or something.
 
I think you can use a button. if you do use a button, you can then use screen.previouscontrol

so this sort of thing is possible.

screen.previouscontrol.setfocus
msgbox screen.activecontrol.name
 

Users who are viewing this thread

Back
Top Bottom