Creating a New Object Class

  • Thread starter Thread starter Dave Ruhl
  • Start date Start date
D

Dave Ruhl

I used to work in Visual Foxpro and I was able to create
a new object class that combined one or more standard
objects. I was then able to use that new object on my
forms just like any standard object. Does Access have
the tools to do that ? What I'd like to do is create a
TextBox object that has standardized GotFocus and
LostFocus Event Procedures (along with a few other
properties). Then I could just add that to my forms
without having to add the code everytime I use the new
object. Thanks!
 
While we can create class objects for code, we cannot create ActiveX, or com
objects with the access IDE. So, we can't make a activeX object.

However, the simple and elegant solution is to simply crate a sub-form with
all the code and events, and anything else you need. You can then drop in
that re-usable form on to any existing form. So, yes, simply create a form
with all the code, buttons or whatever your want..and this becomes a instant
droppable re-usable object for all your forms.

I do this all the time.

Here is article of mine that gives some ideas:

http://www.attcanada.net/~kallal.msn/Articles/fog0000000005.html

In fact, I needed VERY often to prompt for the start/end date, and thus made
a form with a start/end date calendar on it. Even more interesting is that
start/end form was comprised of another single form. So, you can build upon
complexity here.

And, if you are new to ms-access, here is how we handle the "browse"
problem, or the need for a grid control:

http://www.attcanada.net/~kallal.msn/Articles/Grid.htm
 
Back
Top