Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 16th, 2004, 07:05 AM
Registered User
 
Join Date: Jul 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Focus...Subforms

I am trying to hide a subform once it losses focus. I want the action to occur from the subform I want to hide. I have tried using the LostFocus event but apparently even when the LostFocus event is triggered in the subform, the subform still has focus.

How can I go about hiding this subform when the subform losses focus? I don't want to use any other event in the other subforms, I would really like to accomplish this from the subform I am trying to hide.

Eric
 
Old July 26th, 2004, 11:59 PM
Authorized User
 
Join Date: Oct 2003
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try setting focus elswhere, prior to hiding the form, within same procedure.

Private Sub Form_LostFocus()
forms!MainForm.Field1.SetFocus
Me.Visible = False

Possibly Try the OnExit event, from the Main form, unless this also, is not an option.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Subforms 150563a Access 1 June 29th, 2007 04:57 AM
subforms ajmil11 Access 2 January 19th, 2006 11:16 PM
subforms problem yami56 Access 3 January 31st, 2005 04:45 AM
Subforms V Access VBA 1 April 21st, 2004 11:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.