Copy buttons on a form in real time 
Author Message
 Copy buttons on a form in real time

Hi,
can you help me.
I'm trying to build a form in real-time from a set of reports in Access. I can access the access.application object and return a list of reports in the database, then I need to add a button for each report into Vb.
I've tried the following code :
Private Sub Command1_Click()
   Set Command3 = New Command2

    With Command3

        .Top = Command2.Top + 1000
        .Visible = True
    End With
End Sub

but I get the following message :
compile error:
user-defined type not defined.
I've also tried creating my own ocx, but to no avail, I still get the same message.
Can I do this ?
It seems to work with forms, eg dim f as new form1,
f.show, so why not with command buttons ?

Tim Heap
Senior Analyst Programmer
POSTAR Ltd
www.postar.co.uk

*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!



Sun, 09 May 2004 21:07:40 GMT  
 Copy buttons on a form in real time
Look into using a control array.  then use the load, and unload methods to
create and destroy the buttons.


Hi,
can you help me.
I'm trying to build a form in real-time from a set of reports in Access. I
can access the access.application object and return a list of reports in the
database, then I need to add a button for each report into Vb.
I've tried the following code :
Private Sub Command1_Click()
   Set Command3 = New Command2

    With Command3

        .Top = Command2.Top + 1000
        .Visible = True
    End With
End Sub

but I get the following message :
compile error:
user-defined type not defined.
I've also tried creating my own ocx, but to no avail, I still get the same
message.
Can I do this ?
It seems to work with forms, eg dim f as new form1,
f.show, so why not with command buttons ?

Tim Heap
Senior Analyst Programmer
POSTAR Ltd
www.postar.co.uk

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 09 May 2004 23:45:49 GMT  
 Copy buttons on a form in real time

Quote:

>Hi,
>can you help me.
>I'm trying to build a form in real-time from a set of reports in Access. I can access the access.application object and return a list of reports in the database, then I need to add a button for each report into Vb.
>I've tried the following code :
>Private Sub Command1_Click()
>   Set Command3 = New Command2

>    With Command3

>        .Top = Command2.Top + 1000
>        .Visible = True
>    End With
>End Sub

>but I get the following message :
>compile error:
>user-defined type not defined.
>I've also tried creating my own ocx, but to no avail, I still get the same message.
>Can I do this ?
>It seems to work with forms, eg dim f as new form1,
>f.show, so why not with command buttons ?

>Tim Heap
>Senior Analyst Programmer
>POSTAR Ltd
>www.postar.co.uk


You need to make your buttons a control array and then Load each
additional button.  You can find more info in the control array topics
in your VB help file.

HTH,
Bryan
____________________________________________________________
New Vision Software            "When the going gets weird,"
Bryan Stafford                   "the weird turn pro."

Microsoft MVP-Visual Basic     Fear and Loathing in LasVegas



Sun, 09 May 2004 23:55:16 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Copy / Paste special in to a VB app to get real-time numbers updated from Web

2. Copy / Paste special in to a VB app to get real-time numbers updated from Web

3. Copy / Paste special in to a VB app to get real-time numbers updated from Web

4. Moving a shaped borderless form in real time??

5. real time text clock in form

6. Real time: form views to avi file

7. Real Time Control and Timed Routines, please help

8. Compare date in form with date/time in form with date/time in database

9. Mimic Actions Of A Button from Design Time to a WithEvents Button At RunTime

10. resizing buttons - hopefully *real* easy

11. Real-time checking of duplicate entries

12. real time linking

 

 
Powered by phpBB® Forum Software