Effortlessly Convert Access Forms to VB Objects

This article may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. To maintain the flow of the article, we've left these URLs in the text, but disabled the links.

Aa140069.ima-logo(en-us,office.10).gifACCESS 97

Effortlessly Convert Access Forms to VB Objects

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.by Sean Kavanagh

Many developerswork with multiple development tools--it seems that no matter how robust a single programming environment is, there are a few features missing that keep it from being perfect. For instance, because of the speed in which you can create a functional database, Access is great for prototyping applications that will later be created in Visual Basic. One of the downsides to this process is that you can't directly convert your Access forms to VB--you have to re-create them from scratch.

If you've found yourself in this situation, you'll want to check out the Access add-ins we've found that help solve this problem. Objects and properties that aren't supported in VB--like subforms--can't be converted, and some appearance and property differences will most likely still exist between your original and converted forms. However, you'll still be able to spend your time tweaking instead of rebuilding the forms.

Erik Sagalara's freeware add-in Form To VB Export Wizard lets you convert forms on a one-by-one basis to VB 5 FRM files using the dialog box shown in Figure A.

Figure A: The free Form To VB Export Wizard provides limited conversion capabilities.
[ Figure A ]

Although the price is right, the utility is no-frills--only the form itself is converted, without any underlying code. Also, the add-in is unable to translate toggle buttons, OLE/ActiveX controls, or bitmaps. Combobox and list box controls are translated, but their value lists are not. You can download this file at

http://hotfiles.zdnet.com/cgi-bin/texis/swlib/hotfiles/info.html?fcode=000OQ5

Another conversion add-in, Kenneth R. King's MSAccess97 to Visual Basic 4 Forms Conversion, is available for download at

http://hotfiles.zdnet.com/cgi-bin/texis/swlib/hotfiles/info.html?fcode=000SVN

This shareware program, which costs only $10.00 to register, provides a great deal for the money. This add-in provides online help and, as you can see in Figure B, allows you to convert all forms at once.

Figure B: This shareware utility lets you convert all the forms in your database at once.
[ Figure B ]

Although ActiveX controls are not supported, background graphics, list boxes, and comboboxes are converted. Combobox and list box value lists are maintained with the help of some behind-the-scenes source data conversion.

The final add-in we'll look at, IrieSoftware's Access to Visual Basic Object Converter, is pricier at $99.00, but you may find it to be well worth the money. Shown in Figure C, this add-in not only converts your database forms to VB 4 or 5, but your modules as well.

Figure C: IrieSoftware's add-in provides extensive conversion capabilities.
[ Figure C ]

In addition to supporting several ActiveX controls and allowing you to convert multiple objects, the utility provides the option to create a Visual Basic Project file. A feature that could be useful, even just within Access, is the ability to convert macros to code modules within the current database.

Copyright © 2000, ZD Inc. All rights reserved. ZD Journals and the ZD Journals logo are trademarks of ZD Inc. Reproduction in whole or in part in any form or medium without express written permission of ZD Inc. is prohibited. All other product names and logos are trademarks or registered trademarks of their respective owners.