Is the line of code within a form? If not, instead of Me, you want a
reference to the form.
> Hi,
> Thanks for your reply. I have tried
> Set ctlText = Me.Controls.Add("VB.TextBox", "ctlText1")
>
> and it has generated the error "invalid use of me keyword"
Steve Macleod - 10 May 2006 20:59 GMT
ok, thanks for this.
I have attempted to use the form name:
genScriptfrm.Controls.Add("VB.TextBox", "ctlText1")
although this generates an "invalid class string" error.
The code is within a private sub. I am unsure if I must pass a
reference to the form in through the main sub that starts when the
macro is run.
Can anyone advise?
Many, thanks.