CreateControl

Y

Yaya

i m trying to create new control on a form that in design mode but i got this msg like the application can't change name or cancel controls as i request.
Why?
////////////////////////////////////////////////////////////
Dim ctlLabel As Control, ctlText As Control
Dim intDataX As Integer, intDataY As Integer
Dim intLabelX As Integer, intLabelY As Integer

DoCmd.Echo False
DoCmd.OpenForm "Frm1", acDesign


intLabelX = 1
intLabelY = 1
intDataX = 5
intDataY = 5
' Create unbound default-size text box in detail section.
Set ctlText = CreateControl("Frm1", acTextBox, , "", "", _
intDataX, intDataY)
' Create child label control for text box.
Set ctlLabel = CreateControl("Frm_RptGenerator_Filter", acLabel, , _
ctlText.Name, "NewLabel", intLabelX, intLabelY)
' Restore form.
DoCmd.Restore


DoCmd.OpenForm "Frm_RptGenerator_Filter", acNormal
DoCmd.Echo True
//////////////////////////////////////////////////////////////////////
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top