|
-
Apr 23rd, 2001, 02:50 AM
#1
Thread Starter
Lively Member
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
-
Apr 24th, 2001, 12:19 AM
#2
I don't think you need the API
Did you try:
DataGridName.SetFocus
..to set focus to the datagrid?
-
Apr 26th, 2001, 09:43 AM
#3
Thread Starter
Lively Member
-
Apr 26th, 2001, 11:58 AM
#4
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
-
Apr 26th, 2001, 03:47 PM
#5
Thread Starter
Lively Member
Thanks Tygur
This thing was twisting me melons for ages
Your help is invaluable.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|