dreamdelerium
Registered User.
- Local time
- Today, 15:04
- Joined
- Aug 24, 2007
- Messages
- 88
hey everyone, im having some problems with CreateControl method. i have a function that is called when a button is clicked. what i want this function to do is create a text control on a tabcontrol page. it will be called from a button press event (the button is found on the same form as the tab control) my code is as follows:
Code:
if i run this code directly from the module (click the function in the module and press the run button), it works fine. but if i try to call it from anywhere else (another function, sub, event) i get the following error: "MyApplication cant add,rename, or delete the control(s) you requested"
whats going on?
oh, yeah. this function will be called from an access form
Code:
Code:
Function MakeControl()
on error goto errorhandler
Dim ctl As Control
DoCmd.OpenForm "frmLayout", acDesign
Set ctl = CreateControl("frmLayout", acTextBox, acDetail, "Page002")
ctl.Top = 0.5 * 1440
DoCmd.openfrom "frmLayout,acNormal
errorhandler:
MsgBox (Err.Description)
End Function
whats going on?
oh, yeah. this function will be called from an access form