-
Hi Folks
Is there a way to force focus to a datagrid through the API? I have created a master detail form with the wizard. When I create a new master record I cannot tab to the detail datagrid, unless a child entry exists. I am forced to click on the grid to get focus.
Cheers
-
I don't think you need the API
Did you try:
DataGridName.SetFocus
..to set focus to the datagrid?
-
-
There is a SetFocus API.
Put this in the General Declarations area above all the code:
Private Declare Function SetFocusAPI Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long
Here's how to use it:
SetFocusAPI DataGridName.hwnd
-
Thanks Tygur
This thing was twisting me melons for ages
Your help is invaluable.