CreateControl using Access 2000
Posted on 2003-03-18
Hi.. i want to make a form in access 2000 which contains textboxes.. how can i create the textboxes using vba in runtime?
Private Sub Form_Load()
Dim newControl As Control
DoCmd.OpenForm "Form1", acDesign, , , , acHidden
Set newControl = CreateControl("Form1", acTextBox, , , , 100, 100, 1000, 1000)
DoCmd.RepaintObject acForm, "Form1"
DoCmd.Save acForm, "Form1"
I can't find what mistake i made in that program.. Everytime i want to open Form1, there always be a Message Box:
Run-time error '2174':
You can't switch to a different view at this time.
Can somebody help me? Thanks :):)