A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Setting Focus to a field in a subform in 2007



 
 
Thread Tools Display Modes
  #1  
Old November 22nd, 2009, 01:51 AM posted to microsoft.public.access.forms
LilBomShl
external usenet poster
 
Posts: 21
Default Setting Focus to a field in a subform in 2007

How do I set focus on a tab from the last field in a Main form to the first
field in an embedded subform in 2007?
  #2  
Old November 22nd, 2009, 03:15 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Setting Focus to a field in a subform in 2007

The the OnExit event of the last control on Main form use this code:

Me.NameOfSubFormControl.SetFocus
Me.NameOfSubFormControl.Form!NameOfFirstControlOnS ub.SetFocus

Be sure that you replace

NameOfSubFormControl

with the actual name of the subform ***control*** which is not necessarily
the same as the name of the form being used as the basis for the subform.

As you can see, you have to set focus to the subform control ***then*** set
focus to the textbox on the subform.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200911/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.