+ Reply to Thread
Results 1 to 10 of 10

store value in a textbox from the selector

  1. #1
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    store value in a textbox from the selector

    Hi guys

    Can anyone please help me to store the value in a textbox from the selector. Please find attached the spreadsheet. when the user clicks on any button on the selector then it should appear in the textbox. The default number in the textbox will always be 000 that means the max digits will be 3. so when the user selects suppose 7 then in the textbox it will be 007. If again the user types 2 then in the textbox it will be 072. Please have a look at the userform in the attached excelsheet.

    Thanks
    Aman
    Attached Files Attached Files
    Last edited by aman1234; 07-29-2010 at 05:53 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: store value in a textbox from the selector

    Is this what you mean

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: store value in a textbox from the selector

    Try adding a new class module called clsButton and place this code in it
    Please Login or Register  to view this content.
    Put this code in your form module:
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: store value in a textbox from the selector

    The following code works fine for one digit but when the user first types 9 and then 8 that meas 98 then the textbox should have 098.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: store value in a textbox from the selector

    Stephen, The code works fine when we just want to inpuet 1 digit in textbox21 but when we want to input 2 digits number or 3 digits number then it just replace the last digit with the new digit we are typing. e.g if I want to input 23 then I press 2 first and textbox21=002, then i press 3 and textbox1=003 but it should be textbox21=023.

    Quote Originally Posted by StephenR View Post
    Try adding a new class module called clsButton and place this code in it
    Please Login or Register  to view this content.
    Put this code in your form module:
    Please Login or Register  to view this content.
    Thanks
    Aman

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: store value in a textbox from the selector

    Change relevant line to
    Please Login or Register  to view this content.
    This does not allow for text length. Should something happen if they press more than 3 numbers?

    EDIT: perhaps change to this?
    Please Login or Register  to view this content.
    Last edited by StephenR; 07-29-2010 at 08:35 AM.

  7. #7
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: store value in a textbox from the selector

    Stephen, u r genius..Thanks a lot for your help.

  8. #8
    Forum Contributor
    Join Date
    02-20-2009
    Location
    bristol
    MS-Off Ver
    Excel 2003
    Posts
    882

    Re: store value in a textbox from the selector

    Hi Stephen

    I need your help again. Actually there is some change in the clien't requirement. They want to enter in the textbox the value in foot and inches. That means when any user select any value from the selector then it should appear in the textbox in foot and inches. Is it possible to do? Please see the attached file in the previous post and help me to store the value in the textbox in foot and inches.

    Thanks


    Quote Originally Posted by StephenR View Post
    Change relevant line to
    Please Login or Register  to view this content.
    This does not allow for text length. Should something happen if they press more than 3 numbers?

    EDIT: perhaps change to this?
    Please Login or Register  to view this content.

  9. #9
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: store value in a textbox from the selector

    I can't really visualise what is needed here. How does one signify what is feet and what is inches? Perhaps update your workbook with some examples?

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: store value in a textbox from the selector

    Here's the math
    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