Wrapping controls WithEvents in classes (1 Viewer)

Can you review Page 45 please?
Are we talking about the form here, as at yet, there is nothing added to the new class?

This control class will require adding a new variable to clsFrm.
 Open clsFrm
 In the header of clsFrm ass the following line of code:
Private mclsCtlCboRecSel As clsCtlCboRecSel
 Compile and Save the class.
 
No rush. I have stopped for the day anyway,
 
Can you review Page 45 please?
Are we talking about the form here, as at yet, there is nothing added to the new class?

This control class will require adding a new variable to clsFrm.
 Open clsFrm
 In the header of clsFrm ass the following line of code:
Private mclsCtlCboRecSel As clsCtlCboRecSel
 Compile and Save the class.
Gasman, thanks for taking the time to actually do this stuff. You are going to be Head Master of Hogwarts real soon now, I promise.

Private WithEvents mcbo As ComboBox 'Dimension a combo box Withevents

Not text box withevents. Fixed in the book. And in the database.

This section is adding stuff into the new clsCtlRecSelSimple.

The idea is that I have txtRecPK which is bound to the PK of whatever table the form is working with. I really need to right now flesh out comments in the class as well as in the book which explains how this is all going to work. The very first thing i do is add the line in the form but... it can't compile yet because we haven't created (or at least saved) clsCtlRecSelSimple.

Sigh.

I will need to move the instructions to add that line into the form down below where we create clsRecSelSimple and save it.

THEN that new dim in the header of the form class will compile.

Even mad scientists screw up sometimes. <grin>

I'll fix it and push it out to a new pdf. It works in the database because I fixed it there, just not in the book.
 
@Gasman, What do you think about...

Part of the problem with writing is that I have to go back and do the same thing over and over throughout the book as I add new control wrappers. There are a ton of controls, not all of which will ever be used but some will. Which will???

As far as writing this thing, and getting the reader up to speed on this stuff, what do you think about me the author just creating empty classes, presenting them right up front in a little section, and then we can just open up an already existing control wrapper class as we get to it. The basics of any of these wrappers is a header, the Init and term events, an Init(lSomeControl as some control) method.
I could just write the class structure for each and every, compile it so that will happen, then paste it into the book. The reader could now just cut and paste each clsCtlWrapper, insert it into a class and save as the correct class name. Done, empty classes that exist, no compile errors because classes don't exist etc.

I just finished editing the control scanner (in Access) to add code in each and every control type. That stuff is also just cut and paste kinda stuff.

This stuff is tedious as an author, and no doubt as a reader.

Whatdayathink?
 
I think it is OK as it is. It helps towards understanding what goes where.
The only issue copying the code from the pdf is the extra text that gets in the way, like page numbers, and comments not concatenating, so become extra lines. Even had a AllowEdits state which failed the compile, but was actually the tail end of 'Restore the original

I am busy all day today, so will look more at the weekend, so you can take a break. :)
 
I think it is OK as it is. It helps towards understanding what goes where.
The only issue copying the code from the pdf is the extra text that gets in the way, like page numbers, and comments not concatenating, so become extra lines. Even had a AllowEdits state which failed the compile, but was actually the tail end of 'Restore the original

I am busy all day today, so will look more at the weekend, so you can take a break. :)
I have just spent an hour building out missing shell ctl classes, finding and replacing bad naming convention stuff etc.

Do you pull the latest of the pdf and the database from github as you start working with this? Again, I have to keep the book in sync with the db and VV. Any find and replace I do in the db I have to immediately go do in the book.
 
The book writing continues. I have gone through and corrected a bunch of naming conventions whackiness. Any time I do something in the db I have to go make the same corrections in the book. I have also created (in the db) shell classes for every control mentioned in my control scanner in clsFrm, and gotten it all compiling. That has not yet made it into the book.

@Gasman has been doing a terrific job of proof reading and actually doing stuff. Thanks @Gasman! If anyone else wants to start working through it and providing feedback that will also be appreciated.

As so often happens, I have to multi-task and so progress seems sporadic. But it is happening. @Gasman mentioned something a few posts ago I have to go find and fix. That is next.
 
john,

I'm kicking myself in the ass for not looking through your database that has literally been sitting in the corner of my desktop for about a year and a half. For the longest time I've never been able to wrap my head around using collections of classes to do various things. Woke up this morning with one of those AHA! moments and started testing. It's finally making some sense but I doubt I could readily explain it to anyone. I've had pilfered code that I could alter, but never really understood it. I think it was your Control scanner section that got me past the mental block. Thanks!

I've spent the last 4-5 hours working on some old code I had, converting it over to a class. My old code was limited due to the difficulties of dealing with multiple types of controls but I think this may do the trick. So far everything thing has worked perfectly.

I'm going to revisit some of my old classes too.
 

Users who are viewing this thread

  • Back
    Top Bottom