Solved

Why the lost focus function for the form doesn't work?

Posted on 2001-07-23
6
274 Views
Last Modified: 2012-06-27
i write the lost focus function for a form. but it doesn't work at all, when i switch to other form (lost focus of the form), it doesn't run the commands in private sub form_lostfocus()

does anybody know why?
0
Comment
Question by:ppingshi
6 Comments
 
LVL 12

Accepted Solution

by:
Paurths earned 50 total points
ID: 6307854
hi ppingshi

try the  onDeactivate-event of the form...

Private Sub Form_Deactivate()
    MsgBox Me.Name & " wordt gedeactiveerd"
End Sub

cheers
Ricky
0
 
LVL 12

Expert Comment

by:Paurths
ID: 6307861
might be better in english...

Private Sub Form_Deactivate()
   MsgBox Me.Name & " is being deactivated..."
End Sub
0
 
LVL 12

Expert Comment

by:Paurths
ID: 6307879
btw, a form can only receive focus when there are no controls (objects) on the form, or when all visible controls on it are disabled.
Thus, if u click a button to go to another form, the actual form will not lose focus, since it did not have the focus. (So no LostFocus event is triggered)

hope this clears things up,

cheers
Ricky
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 54

Expert Comment

by:nico5038
ID: 6307934
The pop-up type of form doesn't work properly on the events, perhaps that's the case with your form?

Nic;o)
0
 

Expert Comment

by:amp072397
ID: 6783995
ppingshi:

Just a friendly reminder to stay active in your question.

thanks!
amp
community support moderator

7/26
0
 
LVL 5

Expert Comment

by:Netminder
ID: 6958281
Per recommendation, force-accepted by
Netminder
CS Moderator
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now