Creating Objects In VBA

Matt Nash
08-29-2000, 08:52 AM
I'm trying to create some objects on forms and reports in VBA, but I'm having no luck.
I've tried:
<font color=green>Dim cmd1 as object
set cmd1 = new commandbutton
cmd1.visible=true</font color=green>

It keeps saying <font color=blue>ActiveX can't create object</font color=blue>.

I've tried dimensioning the variable as commandbutton, object, everything, but am still struggling.

Could someone please shed some light on this for me?

Thanks in advance, Matt

anhmytran
08-31-2000, 12:22 AM
Do not create a new Command button object.
Load it from an array of Command buttons.

Good luck.

AnhMy_Tran

Matt Nash
08-31-2000, 08:48 AM
Thanks for the reply, but I can't seem to create a control array using access forms although I know I can do it with VB. It keeps giving me the old 'ActiveX can't create object' error. Could you please give me an example?

Matt

anhmytran
09-01-2000, 12:06 AM
I am sorry I don't think Access97 supports control array.

AnhMy_Tran

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum