PDA

View Full Version : How to copy a form including the programming under it?



mud2
09-14-2008, 09:01 PM
It never ends! I want to copy a form containing navigation commands to a form based on one of many forms. So far, the only way I can do this is to copy the form, assign a sourceobject and record, then in design view, put in all the different text boxes, etc that are in the forms I want to use! Even microsoft wouldn't expect this....would they?

CreganTur
09-15-2008, 05:21 AM
I've only found one way to do this- there may be a better way, but if there is I'm unaware of it.

First, you'll have to open both forms in Design View- the form you want to copy objects from and the form you want to put the objects on.

Copy the objects and paste them onto the form- then just move them where you want them.

As for the code, you have to copy that separately via the VBE. The code won't follow the objects if you move them to a different form. You'll just have to copy from one Form module to another.

mud2
09-16-2008, 09:43 AM
Master form with navigation buttons. Contains combobox with names of different forms/tables
various forms for different data sources.
Open Master and one chosen form (Call it data form for now), both in design form...as Randy suggested..(Thank you!)
Put a Tabed Page on Master form.
Click on data form and surround all or chosen fields with rectangular box. NOT the BOX object! Click on any object in this box and Copy.

Click on Master form.
Put mouse on tabbed page and PASTE.

For execution, The chosen SourceObject for the Master form (combobox) must correspond to the particular data form.

Copy different data forms to different tabbed pages, correllate which tabbed page is visible with the chosen SourceObject.
This works, new records CAN be added! But I suppose as I continue ACCESS will "get me"!

Almost too simple and straighforward!

mud2
09-16-2008, 10:21 AM
What if one of the dataforms already contains Tabbed Pages? How does one "Nest" tabbed pages? Simply pasting a tabbed page object on a tabbed page does not work..

CreganTur
09-16-2008, 10:50 AM
You cannot nest tabbed pages- the object simply won't allow it.

Also, if you look closely, you can't paste objects into a tabbed form, you can only create new objects inside the tabbed page.

If you paste an object over a tabbed page it doesn't correspond to either page- it just 'floats' on top of the tabbed page.

Sorry to say you may have to consider changes to the design of some of your forms.

mud2
09-16-2008, 03:35 PM
So how Do I detect a click on the little "Tab", not the page it is connected to? The TabCtl isn't the same as an individual tab. Clicking on the body of a page can be detected and used, but the user may not know to click on the page!

Reason: Caption a TAB with the SourceObject for the whole page...and included naviogation controls. It works IF you click on thr page body...

Yes I could use a "Click on me" control in the page body......