Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using 'hwnd' in Access 2000 VBA

Status
Not open for further replies.

RikHess

MIS
Jul 25, 2002
69
US
I am trying to use a tip I picked up recently that has the code "SendMessage(cboFacility.hwnd, ...)" in it. It is referencing a Combo box.

When I go to Debug -> Compile, I get an error message "Method or data member not found" and '.hwnd' is highlighted.

In the past, I have been able to get by this kind of problem in a compile by checking a box to add a particular Reference (under Tools in the VBA window).

Does anyone have an answer that will help me use this code?

Thank you.
 

Your problem is not particularly with missing a reference.

“hwind” is a common name for what is called a Windows handle. It is returned by a Windows API call. Unless you are rather familiar with the Window interface, you will not get very far with this. It appears that the original programmer hooked into windows to get the windows handle for a window and then is passing this handle to SendMesage.

Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Although I've never used the hWnd with a combo box I have used it successfully with a form and then use it for Windows API procedures. I just confirmed that with a new form. The form itself will have a hidden hWnd property but NOT a combo box. Maybe other controls but I doubt it.

----------------------
scking@arinc.com
Life is filled with lessons.
We are responsible for the
results of the quizzes.
-----------------------
 
Thank you for your help. After studying the tip closer, and trying some other alternatives, I have a workaround that is satisfactory.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top