'Copying multipages on VBA - Copy code within the textboxes

I'm creating a multipage form that can resize itself based on some imput from the user.

The problem I'm facing is the following: when copying the "base" multipage, I'm not able to also copy the code of that multipage to the newly created one.

For example, this is the original multipage:

enter image description here

When clicking on "Fecha de nacimiento", the code does the following:

Private Sub TextBox43_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)

    Dim fecha As Date
    
    fecha = DatePicker.GetDate
    
    If fecha <> 0 Then
        TextBox43.value = fecha
    End If

End Sub

As the code is referred to the "TextBox43", I can't link that code to the new page created, as I don't know witch name will it have.

Any toughts?

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source