
Signature
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
Because of the problem I have, currently there is only code attached to a
"close button" on the form, so that nothing else can be the cause of this
problem. The only item on the form for the moment is the close button. With
another peace of code I am filling up the form with a tab-element with a few
pages (code attaced) It might thus be that the error I receive is due the
this bit of code?
The goal of this form is to create as much tabs as I have rec's in a
particular table.
Before adding pages, I first clear out all pages / tabelements.
The sub is thus used in a peace of code as following:
verwijdertabs "form1"
maakpaginas "form1", "subformame", 3
this is the sub:
Public Sub maakpaginas(formke As String, subformke As String, amount As Long)
Dim i As Integer
Dim frm As Form
Dim aantal As Long
Dim sjek As Boolean
Dim ctltabset As Control, ctlpage As Control, ctlSub As Control,
ctlCheck As Control, ctlCheckLabel As Control, ctlCmd As Control
DoCmd.OpenForm formke, acDesign
Set frm = Forms(formke)
Set ctltabset = CreateControl(frm.Name, acTabCtl, acDetail, , , 500,
500, 9100, 6100)
ctltabset.Pages(0).Visible = False
ctltabset.Pages(1).Visible = False
For i = 0 To amount - 1
Set ctlpage = CreateControl(frm.Name, acPage, , ctltabset.Name)
ctlpage.Caption = "pagina" & i
Set ctlSub = CreateControl(frm.Name, acSubform, , ctlpage.Name, ,
234, 1500, 9000, 4536)
ctlSub.SourceObject = subformke
Set ctlCheck = CreateControl(frm.Name, acCheckBox, , ctlpage.Name, ,
234, 1000)
Set ctlCheckLabel = CreateControl(frm.Name, acLabel, , ctlpage.Name,
, 500, 970, 4500, 250)
ctlCheckLabel.Caption = "Afgewerkt"
Set ctlCmd = CreateControl(frm.Name, acCommandButton, ,
ctlpage.Name, , 2500, 800, 6770, 450)
ctlCmd.Caption = "Maak registratie"
ctltabset.Left = 200
ctltabset.Top = 200
ctltabset.Width = 9100
Set ctlpage = Nothing
Set ctlSub = Nothing
Set ctlCheck = Nothing
Set ctlCheckLabel = Nothing
Set ctlCmd = Nothing
Next i
Set ctltabset = Nothing
Set frm = Nothing
DoCmd.Close acForm, formke, acSaveYes
end sub
thanks for helping out here!
> Hi,
> could be that you have some code associated with deleted tab control, then I
[quoted text clipped - 62 lines]
> >> >
> >> > End Sub
Alex Dybenko - 16 Nov 2006 20:00 GMT
Hi,
perhaps you can use a following workaround - instead of delete all tabs you
can make a "template" form without tabs, then copy it into a new form and
then insert tabs using maakpaginas

Signature
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
> Because of the problem I have, currently there is only code attached to a
> "close button" on the form, so that nothing else can be the cause of this
[quoted text clipped - 132 lines]
>> >> >
>> >> > End Sub