Hi,
Yes, it is possible, but not that easy to do. As you know, a VB form is a text file with the .frm extension. If you print out a simple form, you will see how the VB form is structured. I wrote an FAQ on how to write to a text file (see faq703-3767).
On the Access side, all forms are stored in the AllForms collection. Here is some information from the Visual Basic help inside of Access:
AllForms Collection Example
The following example prints the name of each open AccessObject object in the AllForms collection.
Sub AllForms()
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
' Search for open AccessObject objects in AllForms collection.
For Each obj In dbs.AllForms
If obj.IsLoaded = TRUE then
' Print name of obj.
Debug.Print obj.Name
End If
Next obj
End Sub
So, each form object has properties, which can then be written to your form text file.
HTH,
Randy Smith, MCP
California Teachers Association
Hi,
Obviously, there is alot more to it than just this. For instance, your form will have some properties that are specific to the form, such as recordsource, size, backcolor, forecolor, etc. Then, each control on the form will also have some unique properties, including the type of control, size, location, etc.
You may want to start exploring the MSDN area for Access 2000 for "object models". Here are a few links to get you started: Controls on forms:
It is also possible to add the Ms. A. Forms 2.0 To the references for a VB project. If you do not do this, some of hte pproperties of the Ms. A. Forms will not be available to the VB version os the forms / controls and you will get errors in the VB version. Although I have not attempted to do so, it may be possible, with the Ms. A. Forms 2.0 reference in the VB project, to simply use the copyobject method in VB to just get the complete form object from the Ms. A. App.
Below is the link. It is not all that but maybe you would find it useful. The Demo works only on the Northwind but you can either buy the license or find the license
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.