SelStart trouble related to subForm

Joined
Apr 21, 2012
Messages
3
Reaction score
0
Hi All,

I'm a new registrant to the forum but have been very appreciative of information posted on the site!

I cannot find a solution to this problem, however.

Main form (bound): There are several controls, most disabled to simply display information. Three active controls are (in tab order) 'Comments', 'sub Form' and 'Dummy'. The Dummy field is unbound and simply there to bypass the auto save of the Main Form when exiting the sub Form. The On Focus of the Dummy field immediately sets focus to the Comments field, which by-passes the Auto Save. (This works really well, by the way)

Here's the problem: When tabbing out of the sub Form, focus is put on the Dummy field (verified with a msgbox in testing). The Dummy then immediately passes focus to Comments where I want the existing text, in effect, de-selected and the cursor placed at the end of the string. But the Me.Comments.SelStart = Len(Me.Comments) code (placed in the GotFocus event of the Comments field) is ignored. (Focus on Comments has been confirmed via msgbox test.)

However, If I use the mouse, while focus is in the sub Form, and click on the Dummy field the intended result is successful...focus shifts to Comments, the text is 'de-selected' and the cursor placed at the end of the text. It seems exiting from the sub Form somehow dis-ables the SelStart code even though the chain of events is correct.

I'm baffled and hope someone much brighter than me can help.

Thanks
 
Joined
Apr 21, 2012
Messages
3
Reaction score
0
Ok...forget the whole Dummy field thing. I just learned about the Cycle property, but the behavior coming out of the sub form is still the same.

Any ideas??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top