+ Reply to Thread
Results 1 to 2 of 2

alternative to TextBox1.Activate

Hybrid View

  1. #1
    Registered User
    Join Date
    08-18-2004
    Posts
    97

    Question alternative to TextBox1.Activate

    Hi Forum

    Could you give a hand with the following:

    1. Worksheet with several TextBoxes from Controls Toolbar

    2. In order to jump between the TextBoxes used


    Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    Application.ScreenUpdating = False
    Select Case KeyCode
        Case vbKeyTab, vbKeyReturn, vbKeyDown, vbKeyUp ''' These are the only keys we care about.
        bBackwards = CBool(Shift And 1) Or (KeyCode = vbKeyUp) ''' Determine if we need to move backwards.
        If Application.Version < 9 Then Sheet1.Range("A1").Select ''' In Excel 97 we must select a cell before activating another control.
        If bBackwards Then TextBox3.Activate
        Else TextBox2.Activate ''' Activate the appropriate control based on key(s) pressed.
        Application.ScreenUpdating = True
    End Select
    End Sub
    3. Worsheet runs well protected but when Shared generates a error "Activate method of OLEObject failed"

    4. Debugging the code, found the activate from the TextBox is where the error occurs.
    5 Turn on the "Trust Access to Visual basic Project" but the bug remains.

    6. Is there a way to "jump" to the next TextBox using a method allowed in a shared environment?

    All ideas welcome and appreciated.

    Thanks

    Jose Luis

  2. #2
    Registered User
    Join Date
    08-18-2004
    Posts
    97
    Trying to found a solution I research that changing the textboxes to simple cells I can use
    Application.Goto Reference:=Sheets(1).Range("NameCell")

    Nevertheless, I would like to find a way to keep the Textbox Look and posibility of using their properties.

    All ideas welcome

    Thanks

    Joe Louis

    Quote Originally Posted by jose luis
    Hi Forum

    Could you give a hand with the following:

    1. Worksheet with several TextBoxes from Controls Toolbar

    2. In order to jump between the TextBoxes used


    Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    Application.ScreenUpdating = False
    Select Case KeyCode
        Case vbKeyTab, vbKeyReturn, vbKeyDown, vbKeyUp ''' These are the only keys we care about.
        bBackwards = CBool(Shift And 1) Or (KeyCode = vbKeyUp) ''' Determine if we need to move backwards.
        If Application.Version < 9 Then Sheet1.Range("A1").Select ''' In Excel 97 we must select a cell before activating another control.
        If bBackwards Then TextBox3.Activate
        Else TextBox2.Activate ''' Activate the appropriate control based on key(s) pressed.
        Application.ScreenUpdating = True
    End Select
    End Sub
    3. Worsheet runs well protected but when Shared generates a error "Activate method of OLEObject failed"

    4. Debugging the code, found the activate from the TextBox is where the error occurs.
    5 Turn on the "Trust Access to Visual basic Project" but the bug remains.

    6. Is there a way to "jump" to the next TextBox using a method allowed in a shared environment?

    All ideas welcome and appreciated.

    Thanks

    Jose Luis

+ 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