+ Reply to Thread
Results 1 to 7 of 7

I-beam cursor on form initialize (VB)

  1. #1
    Registered User
    Join Date
    06-07-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2003
    Posts
    20

    I-beam cursor on form initialize (VB)

    The flashing I-beam cursor. On my user form I also have a button for adding the data that has been input, to a row in the spreadsheet, clearing the previous data, and starting over.

    Here's the point:

    On first initialize of the form, I do not have the flashing I-beam cursor anywhere on the form, though focus IS set and ready on the combobox field where I want it.

    On subsequent forms (after invoking the Add to Spreadsheet button and the form gets cleared) then the flashing I-beam cursor DOES immediately appear in the combofield where I want it.

    So, just wondering if it's easy to have the flashing I-beam cursor appear at the very outset, in addition to the focus that is presently and correctly appearing at the outset, instead of only getting flashing I-beam cursor after form has been cleared at least once.
    Last edited by finlander; 06-11-2011 at 01:42 PM.

  2. #2
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: I-beam cursor on form initialize (VB)

    Hi,

    If you right click the userform you can set the "Tab" order. See if this helps.
    Charles

    There are other ways to do this, this is but 1 !
    Be Sure you thank those who helped.
    IF YOU'RE SATISFIED BY ANY MEMBERS RESPONSE TO YOUR ISSUE PLEASE USE THE STAR ICON AT THE BOTTOM LEFT OF THE POST UNDER THEIR NAME.

  3. #3
    Registered User
    Join Date
    06-07-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: I-beam cursor on form initialize (VB)

    Hi Charles,

    Thanks, but neither the Tab order nor the SetFocus seems to get the I-beam to blink in a field when the form is first initialized. Also, when the form is first initialized, I can't just start typing in the focused field. I can tab out of the focused field, but there must be something else that needs to be done to "totally" set focus into a field after the form is first initialized. It's odd, but I imagine it will make sense after it's solved.

  4. #4
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: I-beam cursor on form initialize (VB)

    finlander,

    I just created a code and the cursor flashes in the combobox.
    Would it be possible for you too post a copy.

  5. #5
    Registered User
    Join Date
    06-07-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: I-beam cursor on form initialize (VB)

    sure, here's my initialize code:

    Private Sub UserForm_Initialize()

    Dim cAdList As Range
    Dim cAdSize As Range
    Dim ws As Worksheet
    Set ws = Worksheets("LookupLists")

    For Each cAdList In ws.Range("adID")
    With Me.id_product
    .AddItem cAdList.Value
    End With
    Next cAdList

    For Each cAdSize In ws.Range("adSize")
    With Me.size
    .AddItem cAdSize.Value
    End With
    Next cAdSize

    Me.id_product.ListIndex = 0
    Me.id_product.SetFocus

    End Sub
    The combobox is the id_product

  6. #6
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: I-beam cursor on form initialize (VB)

    Oop's,

    Sorry I meant a copy of your workbook.
    I'll still look at your code though.

  7. #7
    Registered User
    Join Date
    06-07-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: I-beam cursor on form initialize (VB)

    Thanks, Charles. That did the trick. Well done. Enjoy your weekend.
    Last edited by shg; 06-11-2011 at 04:56 PM. Reason: deleted quote

+ 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