Discussion Locked

transfer VBA to VB?

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have been working on a program using
VBA in Acess 2000, but I have found that VBA does not support control arrays. I recently purchased VB6 and was wondering if there is an easy way I can transfer my work(code,forms, etc.) from the VBA in Access to VB6? Are there any other significant differences between VBA and VB6 that I should know about besides the control arrays?

7 replies

by roc180

Q.-"Are there any other significant differences between VBA and VB6" A.- That really depends on what your doing. From a straight code base not really, but it sounds like your dealing with forms and controls. Then their are some significant differences (Grids vs datasheets, cbo box.AddItem vs cbo box.recordsource, loading forms vs opening forms, the list goes on). My suggestion is if you have a lot of development done in Access 2000 find a way around the control array, use a datasheet or write a lot of coce to manage the controls(I know it sucks). If this is not an option grab what ever module level code you can (Copy/Paste) from Access and start from scratch in VB.

Good Luck

Neal Martinelli

by francodacosta

Since VBA is a sub set of VB, you shouldn't have many diffucltis tranfering your code.

You shoul keep in mind that some changes needed to be made to access an database, because Vb don?t support all the Access specific methods such as currentbdTo tranfer the forms use copy & paste.

by achp

No, there is no easy way to transfer code and forms from VBA to VB.

The basic programming concepts are the same. The difference is in the object model. VB has a general-purpose object model, i. e. built-in objects and design tools are applicable for general-purpose programming tasks.

VBA has an object model specifically suited for a specific application. Eg., Access object model has specific objects relating to database management.

The forms in VB and in Access VBA are very different. The behavior of forms in Access is specialized for dataset management. Eg., the very basic property of a form in Access is its data source. Naturally, a VB form has no such property, because it is not specifically designed for dataset management.

Porting a project from Access to VB will require a complete redesign and recreation of all forms. Instead of specifying data source for each form, you will need to create data-aware controls on each form. Maybe, it's a pity that forms within the database cannot be accessed from within a VB projects. The reports will need to be reimplemented using report generating tools like Crystal Reports.

I recommend that, instead of porting your work, you try to find a workaround for array controls.

This discussion is closed to new replies.