+ Reply to Thread
Results 1 to 8 of 8

Set Focus on form at workbook open

  1. #1
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Iowa
    MS-Off Ver
    2007
    Posts
    212

    Set Focus on form at workbook open

    This is likely rather simple, I'm just not seeing the correct syntax.

    When the workbook opens the form "NewProjectfrm" is set to automatically run, which it does.

    The problem is the next two lines of code attempting to set the cursor in the form textbox "JWBNumber"
    I can't think of the missing line I need to make this happen.

    Please Login or Register  to view this content.
    Thank you

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Set Focus on form at workbook open

    Please Login or Register  to view this content.
    Try the above.

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Set Focus on form at workbook open

    I think "NewProjectfrm.JWBNumber.SetFocus" needs to be in the userform_initialize code... that should give it focus when the form loads. And in there, change it to Me.JWBNumber.SetFocus
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  4. #4
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Iowa
    MS-Off Ver
    2007
    Posts
    212

    Re: Set Focus on form at workbook open

    I get an argument not optional error with the .select highlighted
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Set Focus on form at workbook open

    Maybe there's something left unsaid here perhaps this recent thread might help.

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Set Focus on form at workbook open

    Please Login or Register  to view this content.
    Then in userform:
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Iowa
    MS-Off Ver
    2007
    Posts
    212

    Re: Set Focus on form at workbook open

    cytop sent me to one of my previous posts and I saw the difference there.

    For whatever reason the .SetFocus was the issue. The textbox was actually active, just no visible cursor. However, clicking the tab button set the cursor to the next textbox.

  8. #8
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Set Focus on form at workbook open

    Didn't notice the link was too an earlier thread by you... Oh well

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to detect that a certain workbook is open from a form before validating
    By Tea_4_2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-29-2016, 07:19 PM
  2. [SOLVED] Creating a unique form number upon Workbook Open
    By lancekeith in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-15-2013, 02:16 PM
  3. Code to pop-up User Form on workbook open
    By Mile029 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2012, 04:02 PM
  4. [SOLVED] open another workbook - close - see again original form
    By MJR in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-21-2012, 03:09 AM
  5. Workbook doesn't open (Lost Focus)
    By Marc2010 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-24-2010, 01:44 PM
  6. Set focus back to workbook while Form is active
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-11-2009, 04:46 PM
  7. [SOLVED] minimising workbook while having the active form open
    By KT in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2005, 04:07 AM

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