Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Nov 2001
    Location
    Springfield, Virginia, USA
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Restoring focus (2002 on 2000/SR1)

    Folks,

    Using the example in Help, built the following procedures to update photos for individual records on an Access2002 form:

    Private Sub Photo_AfterUpdate()
    On Error Resume Next
    Me![SystemImage].Picture = Me![Photo]
    End Sub

    Private Sub Form_Current()
    On Error Resume Next
    Me![SystemImage].Picture = Me![Photo]
    End Sub

    Problem is, when executed, navigation buttons lose focus and cursor jumps to the middle of the form; making it necessary to (figure out what happened and) manually relocate to navigation buttons to bring up the next record.

    What do I need to do to have the routine(s) return the cursor to the navigation buttons (or wherever the cursor was before calling)?


    Thanx,
    BobM.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Restoring focus (2002 on 2000/SR1)

    Is there other code involved? I fail to see why setting the Picture property of a control would shift the focus.

  3. #3
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Restoring focus (2002 on 2000/SR1)

    I think you are alluding to problem (where "Loading Image" dialog makes cursor jump to middle of screen) discussed in this (somewhat lengthy) previous thread:

    <!post=Re: *.jpg Manager (v2k),283368>Re: *.jpg Manager (v2k)<!/post>

    I'm not sure a satisfactory resolution was ever reached. The post referenced above has a link to this article on the Access Web:

    API: Suppress the "Loading Image" dialog

    I've tried changing the Registry setting as described in article, but did not work - cursor still jumped to middle of screen when image loaded on form. I recall trying the other, more involved technique described, using API functions and Timer event - that didn't work either.... [img]/forums/images/smilies/sad.gif[/img]

    Anyway recommend check out links, maybe you will have better luck than I did....

    HTH

  4. #4
    New Lounger
    Join Date
    Nov 2001
    Location
    Springfield, Virginia, USA
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Restoring focus (2002 on 2000/SR1)

    Hans,

    No. In fact it's the only code in the database so far.


    BobM.

  5. #5
    New Lounger
    Join Date
    Nov 2001
    Location
    Springfield, Virginia, USA
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Restoring focus (2002 on 2000/SR1)

    Mark,

    This does sound like the problem I'm having. Thanks; I'll check the threads you suggested.
    Both sound a little convoluted; is a object.SetFocus a viable alternative? Are there problems
    with that (other than moving 'back' to the wrong object)?


    Thanx,
    BobM.

  6. #6
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Restoring focus (2002 on 2000/SR1)

    I haven't dealt with this problem lately, but when I was trying to resolve this issue with one form, I tried various combinations of using SetFocus method and also locking screen updating while image loaded, none of which seemed to work.... Dave Willet, a participant in the thread previously referenced, often works with images in Access and VB (noted in some of his postings); perhaps he has found a solution for this annoying problem that he can share.... <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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