Search results

  1. jwcolby54

    Using A Collection Class to Raise Common Event

    We want to break things down to small pieces so that each part has a well defined purpose. TheAlphaCommand does nothing but store a pointer to the command button and a pointer to its parent AlphaCmds, and sinks the command button's click event, calling up to the parent class to raise an event...
  2. jwcolby54

    Using A Collection Class to Raise Common Event

    The TheAlphaCommand class does not have a public Name property or function, i.e it does not know how to respond when asked for its name. The compiler figures this out even before runtime (at compile time) and tells the programmer "hey, there is no name property"
  3. jwcolby54

    Using A Collection Class to Raise Common Event

    The locate record can go in the parent class, clsBtn or up in the form. Given that clsBtns raises an event for the child clsBtn classes, I assume the form itself will sink the event from clsBtns and use that to determine which button is calling, and perform the actual task of finding the...
  4. jwcolby54

    Using A Collection Class to Raise Common Event

    And with that I am stepping back. This is @MajP's thread and his code, which very neatly performs the big picture task. And BTW, Allie and I went back to the dock to fish some more tonight. I left my computer safely in the RV. And Allie caught two "gigantic" fish, a sunfish (about 6...
  5. jwcolby54

    Using A Collection Class to Raise Common Event

    OK @Gasman, I am not going to step on this thread. @MajP will explain in detail but... You are correct, you need a collection to store the instances of the button class. A class only stays in existence as long as there is a pointer to it. The collection holds the pointer, keeping the...
  6. jwcolby54

    Using A Collection Class to Raise Common Event

    Yep, simpler is more better (in this case). But I like your solution because it can be easily reused. The listener class can be used by another form, custom code etc. A function is simpler, and simpler to understand but it is single use. But the listener class is generic as you describe it...
  7. jwcolby54

    Using A Collection Class to Raise Common Event

    Does anyone know what the original poster was trying to accomplish. I see a reference to a recordset or table or something but why?
  8. jwcolby54

    Using A Collection Class to Raise Common Event

    Mikey likes it! And barely under 5 pages. GOOD JOB! Pullin your chain @MajP . I wasn't following the original thread so I have no idea what the big picture was supposed to do. But I do like passing in the parent and then calling the method in the parent to raise the event. My only real...
  9. jwcolby54

    The message class - RAISING events

    ClsAlphaCmd doesn't raise events. That is why the compiler complained. Dim mlClsAlphaCmd As ClsAlphaCmd will compile without that error. The next thing is to use error handlers. I use MZ-Tools which allows me to actually set up my own error handler code which I can insert at the click of a...
  10. jwcolby54

    The message class - RAISING events

    I took my daughter fishing this morning. I don't fish nor care to fish. Allie though wants to go fishin with dad. So dad... decides to take my lapboard, laptop and mouse down to the lake and try and do stuff while the fish are stealing our worms. DROPPED MY MOUSE IN THE LAKE! That would be...
  11. jwcolby54

    The message class - RAISING events

    LOL, that's OK.
  12. jwcolby54

    The message class - RAISING events

    I am not seeing the entire class. Did I miss something?
  13. jwcolby54

    The message class - RAISING events

    What do you want your class to do? What does you code currently look like? Remember in the book I had Header variable stuff Initialization events etc
  14. jwcolby54

    The message class - RAISING events

    This err Dim WithEvents mlClsAlphaCmd As ClsAlphaCmd is TELLING the compiler that my class RAISES events! the compiler is telling you that your ClsAlphaCmd doesn't RAISE any events. by declaring your mclsAlphaCmd "Withevents", you are telling the compiler "my class can raise an event"...
  15. jwcolby54

    The message class - RAISING events

    "does not source automation events" means it does not raise its own events.... Hard to nudge without being too explicit. A command button raises a ton of events, click etc. Your class can raise its own events...
  16. jwcolby54

    The message class - RAISING events

    I am pasting it from the VBA editor. Which is not "proper" editor or for that matter a "proper" language:eek::unsure:(n), at least according to the widget that opens.
  17. jwcolby54

    The message class - RAISING events

    Sorry, I didn't even know that existed. BTW it is a bit of a PITA as it inserts a blank line between every line of code. Can that be overridden somehow? And wouldn't ya know, VB / VBA is not even included as a language type. Damned snobs!
  18. jwcolby54

    The message class - RAISING events

    The only scope modifiers used by most of us devs is public and private. For functions, Public is the default unless private is specified. Static and friend are very special case. The friend modifier is another scope keyword. The static keyword discusses whether the values of variables inside...
Back
Top Bottom