Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access 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
  #1 (permalink)  
Old December 29th, 2003, 03:56 AM
Registered User
 
Join Date: Dec 2003
Location: , , Israel.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to simmy
Default Setfocus from button on Commandbar

I am using a button on a command bar to change a subform on my main form. My problem is that it doesn't set the focus to the subfrom or any control on it. I have tried using setfocus on both the subform and controls on it, no luck.

Please help!
Thanks!

  #2 (permalink)  
Old December 29th, 2003, 10:57 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

Try this article, it might help your situation.
http://support.microsoft.com/?kbid=209689

  #3 (permalink)  
Old December 29th, 2003, 11:31 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Are you sure you're referring to the control on the subform correctly? Suppose you had a form called frmMyMainForm and a subform called sfrMySubForm. On the subform you had a textbox called txtMyTextBox. Then on the button's On Click event, setting the focus would look something like this.

Button is on the main form:

   Me.sfrMySubForm.Form.txtMyTextBox.SetFocus

Button is on the subform:

   Me.txtMyTextBox.SetFocus


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division


Similar Threads
Thread Thread Starter Forum Replies Last Post
Form does not open when commandbar button clicked Arsi BOOK: Professional Outlook 2007 Programming ISBN: 978-0-470-04994-5 21 March 5th, 2009 04:03 AM
Popup type CommandBar in Outlook sumit_kalra Access VBA 1 September 25th, 2004 11:56 AM
Setfocus from button on Commandbar simmy Access VBA 2 December 29th, 2003 11:45 AM
Popup type CommandBar into Outlook sumit_kalra Excel VBA 0 July 10th, 2003 06:20 AM
Subform Setfocus Steven Access 4 June 11th, 2003 12:38 AM





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