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.
 

Users who are viewing this thread

Back
Top Bottom