Copy Form Frames With VBA

J

Jerry Bodoff

Hi,

In VBA how do you programmatically copy a frame
containing controls from one form to another form?

I have a number of forms that use the same frame which
contains a ComboBox and associated command buttons. The
only difference on each form is that the frame caption
and the ComboBox data is different. The code that I
have come up with so far is:

load form1
form1.frame.copy
form2.controls.add ???????????

I am not sure what the ??????? should be. I have also
tried form2.paste which I think was a totally wrong
approach.

Any help and pointers would be appreciated.

Thanks in advance.

Jerry Bodoff
 
W

Word Heretic

G'day "Jerry Bodoff" <[email protected]>,

You use just one form and modify the two objects as required. For
example, if you use a property of the form called Method as Long, you
could set Method to 1 or 2 before showing the form and then use Method
from inside the form code to a) label the things differently and maybe
even b) to handle things differently.


Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


Jerry Bodoff reckoned:
 
J

Jerry Bodoff

Hi Steve,

Thanks for your reply. That is basically what I finally
came up with. I put the frame in its own form and then
used the form as a kind of "dialog box" using public
module variables to pass any arguments.

Once again, thanks for your reply and help.

Jerry Bodoff
 

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