• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Add new record by adding textbox

Visor

Member
Dear friends of the forum, I cordially greet you. After reviewing how to solve my problem I have not been able to solve it. I want to be able to make a way to go slowly adding records, which consists of making the hidden textbox appear, which gives the appearance of adding new records.
The search button displays the data for each student.
The Input button takes the data to the worksheet (but I can not make it into a number format)

As you will see I have built three designs I would like to observe how it would work properly.
When initializing the userform is seen a bit, clicking on the star (New) shows new record, until there I have achieved.
I have been able to do a bit but the rest I do not see the way.


I thank you for helping me with this topic.
Upload a file to see it
 

Attachments

  • Input New register.xlsm
    48.3 KB · Views: 10
Simila to this is possible, but I dont know how to do put four textbox and keep en form to next time that I will open:


Code:
    Dim oButton As MSForms.CommandButton

    Dim i As Long, j As Long
    Set oColl = New Collection
   
'Primer Textboxs Fechas, Textboxs del 1 al 20
    For i = contador To contador
            j = i
            Set cItemHabit = New Cl_Textbox ' la clase Cl_Textbox inserta un botton y dos label
           
            With cItemHabit
                'Primer parametro es el Frame contenedor, Segundo numero de textbox, _
                Tercero el numero de fila, el resto es Left,Top,Width y Height
               
                .Init Frame1, j, i, 10, (j - 1) * BtnHeight + 27, BtnWidth, BtnHeight
                .Textbox = Format(Date, "DD - MMMM - YYYY") & "  " & "tbx" & contador
            End With
           
            oColl.Add cItemHabit 'Collecion que almacena las clase creadas.
 
    Next

    Frame1.ScrollHeight = j * BtnHeight + 10
contador = contador + 1




any help?
 
Hi, Visor!
When posting, text or code, or when uploading files, it's better if all comments or descriptions are either in English or both in the original language and translated.
In code is preferable to use variable and constant names in English but it's not so relevant.
Regards!
 
Last edited:
I am sorry.
It's because I'm from Ecuador and I do not understand English very much, I do what I can. In any case thank you for coming to this subject.
Here I have translated a little, I hope it is better understood

In the example I have of the first spot I have clearly exposed what I hope but I do not manage to make everything work. I've made the code a bit but I can not make it work for everything.
Maybe I'm on the wrong way, but that code causes textbox to be added, I can not complete the rest
I can arrest your collaboration

Code:
Dim oButton As MSForms.CommandButton

     Dim I As Long, As As Long
     Set oColl = New Collection
   
'First Textboxs Dates, Textboxs from 1 to 20
    For i = counter To counter
             J = i
             Set cItemHabit = New Cl_Textbox 'class Cl_Textbox inserts a botton and two label
          
             With cItemHabit
                 'First parameter is the container frame, second number of textbox, _
                 Third the row number, the rest is Left, Top, Width and Height
              
                 .Init Frame1, j, i, 10, (j - 1) * BtnHeight + 27, BtnWidth, BtnHeight
                 .Textbox = Format (Date, "DD - MMMM - YYYY") & "" & "tbx" & counter
             End With
           
             OColl.Add cItemHabit 'Collection that stores the created classes.

     Next

     Frame1.ScrollHeight = j * BtnHeight + 10
Counter = counter + 1
 
Hi, Visor!
Translation is fine, surely more people can now understand better your issue. Thanks for your efforts.
FYI, it's not my case, I'm from Argentine, but English is the language here and we all must follow the rules.
I'm a bit busy for the time being, I'll try to give a look at it but it's not fully guaranteed.
Regards!
 
I have already solved the subject I thank for the interest in this subject. I have solved it with class module, only something I get a little bad but good is acceptable

Theme solved
 
Hi, Visor!
Congrats that you could solve it yourself. Thanks for your feedback and welcome back whenever needed or wanted.
Regards!
 
Back
Top