Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setfocus to a field in a subform 7

Status
Not open for further replies.

franksirvent

Programmer
Mar 8, 2002
358
GB
Hi
I have a form and subform.
The form has a field, after update it runs an sql and the subform displays the results (the subform is sheet format)
I then do the following to move the focus to the first field in the subform:
Me![Arriving Containers]![Container].SetFocus

However this is not working!
I am not getting an error, it just highlights the CONTAINER field, but the focus continues to be on the SEARCH field of the MAINFORM.
I´ve checked the code in case I moved it back to the SEARCH FIELD however I see no code which does this...

Can anyone help ?

thanks in advance

 
I can get this to work be setting the focus to the subform first, then to the control on the subform.

For example:

Me![SubFormName].SetFocus
Me![SubFormName]![SubFormField].SetFocus

It should work as one statement, but I could not get it to work correctly.

Good Luck! Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
Anthony...

you are the man!

Works perfectly!!!!

there goes a star!


thanks so much!
 
This Access bug shows up on forms also. What I do to workaround Microsoft's glitch is to set focus on the next control in the form (i.e., next in the tab order), then set focus on the control I really want it on.

I wish they'd fix this bug! It's annoying....[mad]

Judge Hopkins


There are only two rules for success: (1) Never tell everything you know.
 
Judge
You are a savior! I've been trying everyone's suggestions, and getting many lumps on my head from pounding it on the desk! Your suggestion worked! This star is for you!
 
ajdesalvo, - hi.

Many, many thanX for your suggestion (Feb 13th '03).
Was just what I was looking for!

You have a star from me!

CheersABunch!!

Magnetar [atom]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top