Hi John
This appears to work:
========================================================================
Private Declare Function SetWindowText _
Lib "user32" _
Alias "SetWindowTextA" ( _
ByVal hWnd As Long, _
ByVal lpString As String _
) As Long
Private Declare Function FindWindowEx Lib "user32" _
Alias "FindWindowExA" ( _
ByVal hWndParent As Long, _
ByVal hwndChildAfter As Long, _
ByVal lpszClass As String, _
ByVal lpszWindow As String _
) As Long
Public Function SetNavPaneSearchText(NewText As String) As Boolean
Dim hWnd As Long
hWnd = FindWindowEx(hWndAccessApp, 0, "NetUINativeHWNDHost", "Navigation Pane Host")
If hWnd = 0 Then Exit Function
hWnd = FindWindowEx(hWnd, 0, "NetUIHWND", "")
If hWnd = 0 Then Exit Function
hWnd = FindWindowEx(hWnd, 0, "NetUICtrlNotifySink", "")
hWnd = FindWindowEx(hWnd, 0, "RICHEDIT60W", "")
If hWnd = 0 Then Exit Function
SetNavPaneSearchText = SetWindowText(hWnd, NewText)
End Function
========================================================================
However, I can’t work out how to effect the search, so it’s pretty useless really!
I can’t help thinking there must be a better way of achieving what you want. I would NEVER let an end user even SEE the nav pain, never mind search for things in it ;-)
Cheers,
Graham
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of John Heinze
Sent: Monday, 10 March 2014 16:00
To: ms_access_professionals@yahoogroups.com
Subject: [MS_AccessPros] navigation bar - search
Is there a way to use VBA to enter a value in the search box when a form is loaded?
."The only real mistake is the one from which we learn nothing."
John Powell (1834-1902)
"Patience is the companion of wisdom."
Saint Augustine (354 AD - 430 AD)
"Success is the ability to go from one failure
to another with no loss of enthusiasm."
Sir Winston Churchill (1874 - 1965)
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (4) |
Tidak ada komentar:
Posting Komentar