Results 1 to 6 of 6

Thread: Activefocus/SetFocus problem

  1. #1

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Angry

    Hi,
    I'm still trying to keep positive track on the focus of my form while I'm using the arrowkeys.
    My present ideas goes like: Save Control with focus, then check for keypressed of arrowkeys, then reset the focus to the old position.
    To me the ides is worth a try, but I'm stuck with a problem.
    I can determine the control wich has the focus (Activefocus), but how to reset the focus back to that control?
    Thanks
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  2. #2
    Lively Member
    Join Date
    Jan 2001
    Posts
    115

    Cool

    Try

    Control.Setfocus

  3. #3

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Nice idea, but whow
    I tried it with
    Code:
    temp=form.activecontrol
    ...
    ...
    ..
    temp.setfocus
    that doesn't work. told you, I'm stuck
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  4. #4
    Lively Member
    Join Date
    Jan 2001
    Posts
    115

    Cool

    What do you mean doesn't work? If you set the temp correctly, temp.setfocus will set focus back to that control.

  5. #5

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    I mean:
    Runtime Error 424 Object needed

    btw I decleared Temp as variant
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  6. #6
    Lively Member
    Join Date
    Jan 2001
    Posts
    115
    Oh, okay, try this way

    dim Temp as Control

    set Temp = me.activecontrol

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