+ Reply to Thread
Results 1 to 20 of 20

Textbox Events

  1. #1
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Textbox Events

    Hello, i don't know where the code is wrong or placed this code in wrong event. I just want in the "Update Existing" tab, when i input a data in "Quote Number" field and press enter the code will trigger, and when i erase the data that I input in "Quote Number" field, all the data in the fields will be erase also.



    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Textbox Events

    Can anyone lend me a hand on this please?

  3. #3
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Textbox Events

    Could anyone help me on this?

  4. #4
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Textbox Events

    Goodmorining all!, can anyone help me on this?

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Textbox Events

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Textbox Events

    Hi Alphafrog, thanks!, but still when i try to input a data in "Quote number" field without pressing enter, all fields has been populated.

    I just want to populate the fields once I press enter.

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Textbox Events

    When you press enter, you exit the textbox. Use the _Exit event trigger.

  8. #8
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Textbox Events

    I've move the code to Exit event, but when i press enter, there's nothing happen...

    Please Login or Register  to view this content.

  9. #9
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Textbox Events

    Use the _AfterUpdate event instead.

  10. #10
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Textbox Events

    Also, use this to look for an exact quote number match.

    Set c = .Find(strFind, LookIn:=xlValues, LookAt:=xlWhole)

  11. #11
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Textbox Events

    You saved my day again Alpha! Thank youuu sooo muuchh!

    By the way could you try to run the below file. When i try to run the macro, it seems like it's slow or hang? the userform where replicated to many when i try to drag it somewhere.

    I've also attached the screenshot.
    Attached Images Attached Images
    Attached Files Attached Files

  12. #12
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Textbox Events

    In the TextBox14_AfterUpdate procedure, you turn off screen updating but you don't turn it back on. Add this to the end of the procedure.
    Application.ScreenUpdating = True

    Or better yet, don't turn off screen updating in that procedure. It's only useful when you write the data to the worksheet with CommandButton2 and you already toggle screen updating in that procedure.

  13. #13
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Textbox Events

    Hi Alpha, i just want the userform stay in Sheet3, that's why i set screen updating to false. Is there any solution for that?

  14. #14
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Textbox Events

    One has nothing to do with the other.

  15. #15
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Textbox Events

    When i search for a quote number, i don't want the quote number that i search to be visible(Sheet1), i just want the userform run/stay in Sheet3. I've tried to set the Sheet1 visible to false and set screenupdating to true but still it lags/slow. Is there away to resolve that issue: updating sheet without switching?
    Last edited by puuts; 04-15-2013 at 02:21 AM.

  16. #16
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Textbox Events

    Don't select Sheet1. It's not required.

    Delete these lines
    Application.ScreenUpdating = 0
    Sheet1.Visible = True
    Sheet1.Activate


    And this one.
    c.Select

    You may have other lines to clean up. I didn't check all the code. But again, you don't have to select sheet1 or cells on sheet1. You can write to it without selecting it.

    Did you write this code?

  17. #17
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Textbox Events

    Actually it's from RoyUK sample database. I've modified and add something to looks like the same what i want.

  18. #18
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Textbox Events

    How do i select the quote number that i want to update and overwrite the data that i want? I'm having trouble in "Update" Button.
    Attached Files Attached Files

  19. #19
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Textbox Events

    *****up*****

  20. #20
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Textbox Events

    Anyone could help me with update button and search (textbox event) for the above attachment?

+ 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