+ Reply to Thread
Results 1 to 7 of 7

IsDate & SetFocus

  1. #1
    Registered User
    Join Date
    01-29-2013
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    68

    IsDate & SetFocus

    I'm trying make sure of a date entry in 2 textboxes.
    I'm using the following code, the problem is the setfocus moves on to the next tabstop.

    If I F8 thru the code the focus is set properly until it exits the sub.

    Please Login or Register  to view this content.
    thanks

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: IsDate & SetFocus

    Use the AfterUpdate event rather than Exit.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    01-29-2013
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: IsDate & SetFocus

    thanks, I'll give that a try as soon as I get in the am.

  4. #4
    Registered User
    Join Date
    01-29-2013
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: IsDate & SetFocus

    No, this doesn't seem to solve the problem, the focus still moves to the next text box.

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: IsDate & SetFocus

    Perhaps
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-29-2013
    Location
    texas
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: IsDate & SetFocus

    Thanks Mike,
    This is what I wound up with. For some reason I got "object required" with yours and I don't know why.
    I appreciate the help, I would never have gotten there.
    Please Login or Register  to view this content.

  7. #7
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: IsDate & SetFocus

    As you have it written, the With txtPurchaseDate and End With are not needed.

    AHHH, I see your control is named txtPurchDate, no "ase"

    Try
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1