Results 1 to 6 of 6
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    simple SetFocus

    how come at the end of the following code (which executes without error), i don't find the curser blinking and waiting in txtLeadTime2 ?
    actually, i'm not certain where it is waiting; i don't see it blinking anywhere (!?)



    ...
    Response = MsgBox(vPrompt, vbInformation, "INVALID DATE RANGE")
    Me.txtLeadTime2 = ""
    Me.txtLeadTime2.SetFocus
    ...

    as always,
    many thhanks in advance
    mark

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What event is this code in?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    it's in the after update event

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The after update event of...?

    If it's that same control, you'd be better off using the before update event and

    Cancel = True

    Typically the before update event of a control or form is used for data validation. To do what you're doing, you likely need to set focus somewhere else and then back where you want it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    gotcha
    thnx

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem; post back if you get stuck.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. setfocus on an textbox different way
    By white_flag in forum Access
    Replies: 0
    Last Post: 09-21-2011, 05:04 AM
  2. setfocus on an textbox
    By white_flag in forum Access
    Replies: 2
    Last Post: 09-21-2011, 04:16 AM
  3. SetFocus problem
    By JvdP in forum Forms
    Replies: 0
    Last Post: 03-16-2011, 08:55 AM
  4. SetFocus Problem
    By ColPat in forum Programming
    Replies: 2
    Last Post: 06-21-2010, 04:43 AM
  5. SetFocus Issue
    By Sinjin in forum Access
    Replies: 0
    Last Post: 02-14-2008, 07:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums