XL VBA Question re Text Boxes
-
I want an input from UserForm1 to be a Number. I want to carry that number into UserForm2. If, say that figure was 3, then I want either... Three TextBoxes to open/be visible, OR I want to ask for input on the Same TextBox 3 times, assigning each value to an array. What I have at the mo is this... UserForm one has a Text box asking for tbNumberOfUnits, and an Enter Button. On Enter it checks that the value is a number not text, throws exception. Assuming it is ok, it calls UserForm2 by "UserForm2.Show" There is a CommandButton Begin on UserForm2 At this point I would like the value of tbNumberOfUnits to be called, but it appears not to exist in UserForm2. Also, How do I create TextBoxes to the Desired amount? Any help/pointers would be appreciated, I have checked a couple of books and can't seem tofind what I want, and also feel I may not be asking the right questions from Google.
------------------------------------ We hang the petty thieves and appoint the great ones to public office. - Aesop
-
I want an input from UserForm1 to be a Number. I want to carry that number into UserForm2. If, say that figure was 3, then I want either... Three TextBoxes to open/be visible, OR I want to ask for input on the Same TextBox 3 times, assigning each value to an array. What I have at the mo is this... UserForm one has a Text box asking for tbNumberOfUnits, and an Enter Button. On Enter it checks that the value is a number not text, throws exception. Assuming it is ok, it calls UserForm2 by "UserForm2.Show" There is a CommandButton Begin on UserForm2 At this point I would like the value of tbNumberOfUnits to be called, but it appears not to exist in UserForm2. Also, How do I create TextBoxes to the Desired amount? Any help/pointers would be appreciated, I have checked a couple of books and can't seem tofind what I want, and also feel I may not be asking the right questions from Google.
------------------------------------ We hang the petty thieves and appoint the great ones to public office. - Aesop
Hi, Based on my understanding you want to pass value from one form and generate textbox dynamically.So you can have a global variable and store value in tat variable from userform1.and in the page load of userform2 generate as number of textboxes dynamically using for loop.Otherwise get input as many times and get in an array.Store the values in the DB by using arr(0),arr(1)... like that. pls free to ask again if i have misunderstood your problem.
Believe!Success is always yours.
-
Hi, Based on my understanding you want to pass value from one form and generate textbox dynamically.So you can have a global variable and store value in tat variable from userform1.and in the page load of userform2 generate as number of textboxes dynamically using for loop.Otherwise get input as many times and get in an array.Store the values in the DB by using arr(0),arr(1)... like that. pls free to ask again if i have misunderstood your problem.
Believe!Success is always yours.
That is it in a nutshell.
------------------------------------ We hang the petty thieves and appoint the great ones to public office. - Aesop
-
That is it in a nutshell.
------------------------------------ We hang the petty thieves and appoint the great ones to public office. - Aesop
can you give me your requirement with your code
Believe!Success is always yours.