chedarmaster
New Member
- Joined
- Aug 29, 2011
- Messages
- 7
Greetings, masters.
I bring you:
1 form - named frmLavandaria
2 multipages - First Named multipageEmpregados
Second Named MultiPage1
In the code I try to add a new page to the first but it's impossible, it allways says it cannot find the "Specified Object". I'm using the:
"set NewPage = frmLavandaria!multipageEmpregados!Pages!Add"
And I have tried also the "frmLavandaria!multipageEmpregados!Pages!Add".
HOWEVER, if I just do:
"frmLavandaria.MultiPage1.Pages.Add"
it adds a new page to the MultiPage1 control even in Runtime without any problem!
Can I not rename a MultiPage? Is that what renders it useless in the code?
Sub cmdButtoncontratarempregado_Click()
Dim i As Integer
'Dim NewPage As Msforms.Page
Dim LavandariaEmpregadoPage As Msforms.Page
i = 0
For Each LavandariaEmpregadoPage In frmLavandaria.MultiPage1.Pages
i = i + 1
Next LavandariaEmpregadoPage
frmLavandaria.MultiPage1.Pages.Add
'Set NewPage = frmLavandaria!multipageEmpregados!Pages!Add
(Please mind that when I remove the " ' " I also rewrite the
whole code to use multipageEmpregados instead of MultiPage1)
frmLavandaria.Repaint
frmLavandaria.MultiPage1.Pages(i).Caption = "Emp" & CStr(i + 1)
End Sub
I bring you:
1 form - named frmLavandaria
2 multipages - First Named multipageEmpregados
Second Named MultiPage1
In the code I try to add a new page to the first but it's impossible, it allways says it cannot find the "Specified Object". I'm using the:
"set NewPage = frmLavandaria!multipageEmpregados!Pages!Add"
And I have tried also the "frmLavandaria!multipageEmpregados!Pages!Add".
HOWEVER, if I just do:
"frmLavandaria.MultiPage1.Pages.Add"
it adds a new page to the MultiPage1 control even in Runtime without any problem!
Can I not rename a MultiPage? Is that what renders it useless in the code?
Sub cmdButtoncontratarempregado_Click()
Dim i As Integer
'Dim NewPage As Msforms.Page
Dim LavandariaEmpregadoPage As Msforms.Page
i = 0
For Each LavandariaEmpregadoPage In frmLavandaria.MultiPage1.Pages
i = i + 1
Next LavandariaEmpregadoPage
frmLavandaria.MultiPage1.Pages.Add
'Set NewPage = frmLavandaria!multipageEmpregados!Pages!Add
(Please mind that when I remove the " ' " I also rewrite the
whole code to use multipageEmpregados instead of MultiPage1)
frmLavandaria.Repaint
frmLavandaria.MultiPage1.Pages(i).Caption = "Emp" & CStr(i + 1)
End Sub