Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Export / Import

Status
Not open for further replies.

DGA15

Programmer
Aug 19, 2000
40
0
0
US
Using Access 2000

How can I have a form (which has ActiveX and controls) with all it’s code exported, ready for importing into some other Access DB/program.

Now I have both a Form and a Class Module which are exported separately. Is there anyway to have this exported (ready for later importing) as one item?

DGA15


 
I think this would be either a whole lot of coding, for you to have control over the whole process, or you could also try the undocumented savastet/loadfromtext methods of the application object. Since these are not documented, it means they are subject of changes ...

[tt]application.saveastext acform, "frmYourForm", "c:\frmYourForm.txt"

' then in another db
application.loadfromtext acform, "frmYourForm", "c:\frmYourForm.txt"[/tt]

If you mean you have an extra class module, not only the forms class module, you'll need one extra "line" for that too.

I don't know how well it works wiht ActiveX objects ... so you'll need to test, if you think this might work for you. Be carefull not to alter the exported text file, though.

And, you are sure you can't import/export directly? I mean having a source db somewhere and do something like

[tt]docmd.transferdatabase, acImport, "Microsoft Access", _
"c:\source.mdb", acForm, "MyForm", "NewForm"[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top