?
Solved

LostFocus

Posted on 1998-03-21
2
Medium Priority
?
579 Views
Last Modified: 2008-03-17
When moving from one MDI-child to another i don´t want some LostFocus events to be fired. I use the    
=> If Screen.ActiveForm.hWnd <> Me.hWnd Then Exit Sub
on some controls but how to do this i i have a ActiveX-Control in a MDI-Child and the ActiveX-Control contins a grid where i don´t want the SS_LeaveCell event to be fired.

I have try with this sample but the Screen.ActiveForm is not set when I am in the grid in the ActiveX-Control.

Private Sub SS_LeaveCell(ByVal Col As Long, ByVal Row As Long, ByVal NewCol As Long, ByVal NewRow As Long, Cancel As Boolean)

    If UserControl.Parent.hWnd <> Screen.ActiveForm.hWnd Then Exit Sub
    'My other code after this....
      
End Sub
0
Comment
Question by:jannea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
Acid_Buzz earned 100 total points
ID: 1459537
Try to use a boolean property, replacing Scree.ActiveForm.. set it to true when form gotfocus or form is activate and false when form lost focus.. this is more easy to know how the form is activate..
0
 
LVL 1

Author Comment

by:jannea
ID: 1459538
Sorry Buzz, I´ll been gone for a while...

OK but, how to from my OCX find out the hWnd of the form who´s contain my OCX, that´s my mainproblem...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question