Results 1 to 3 of 3

Thread: setting focus causing trouble

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2005
    Posts
    530

    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.

  2. #2
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    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..

  3. #3
    Addicted Member garyjohn_2000's Avatar
    Join Date
    Apr 2005
    Location
    Timbaland
    Posts
    243

    Lightbulb Re: setting focus causing trouble

    You could create a counter or a boolean for the update....like:
    VB Code:
    1. Dim updatedvalues as Boolean
    2.   updatedvalues = True
    and then update the Textbox in the GotFocus event of the particular Tab page like:
    VB Code:
    1. If updatedvalues = True then
    2.         Textbox11.Setfocus()
    3.         Textbox11.Text = [i]abc[/i]
    4.         Textbox1.SetFocus()
    5.         ...
    6.         ...
    7. End If

    I know its a n00bish way but I think it helps...



    Peace!
    Last edited by garyjohn_2000; Aug 4th, 2005 at 04:46 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width