bind form to class?

  • Thread starter Thread starter Craig Buchanan
  • Start date Start date
C

Craig Buchanan

Is it possible to bind a form to a class' method? If so, what are some of
the issues related to this?

Thanks,

Craig Buchanan
 
No.

But you can certainly add new methods to a form, since a form is in fact a
class object.

This also means you can have multiple instances of a form opened at the same
time.

However, I certainly often add a class object to a form. You can expose that
object by declaring the object as public in the forms module. Like:


Option Compare Database
Option Explicit

Public MyTour As New CRide ' Tour class object


Now, any code can use, or set, or get properties/methods of that object
like:


forms!Customer.MyTour.HotelCapacity

So, often, I do add a class object to the forms module defs, and if you make
it public, then you can use all of the features of object. And, remember,
you can still have multiple instances of that form open, and each form will
thus have its own copy of that object.

Here is an article on using class objects in access:

http://www.attcanada.net/~kallal.msn/Articles/WhyClass.html
 
Back
Top