setting focus causing trouble
Hello,
I'm working on an app in Access2000 where I have to manipulate text in a textbox. The problem is, the text box in on a different tab than some other controls and I need to have the text inside the text box respond to what is happening in the other controls. I know I could do this with an intermediate variable, but that causes a lot of other trouble for other reasons. Anyway, the problem I'm having is that each time one of these controls is changed, I need to update the text box and to do so I have to set focus on the text box. Well, this causes the tab to change to show the text box, then change back to the original tab with the controls. What a pain!! (Oh, if this could only work like VB.NET I wouldn't have this problem) Does anyone know how to write to the text property of a text box without giving the text box focus? Or, at least stop Access from bringing it to the front??
Thanks.
Re: setting focus causing trouble
I don't think its possible. I havent found a way to get around the set focus, and I believe someone on these forums told me you couldnt.
And I don't see why you would be able to set focus to an object, but not its container..Sorry to say..
Re: setting focus causing trouble
You could create a counter or a boolean for the update....like:
VB Code:
Dim updatedvalues as Boolean
updatedvalues = True
and then update the Textbox in the GotFocus event of the particular Tab page like:
VB Code:
If updatedvalues = True then
Textbox11.Setfocus()
Textbox11.Text = [i]abc[/i]
Textbox1.SetFocus()
...
...
End If
I know its a n00bish way but I think it helps...
Peace! :wave: