Search results

  1. D

    Solved Encapsulate Function In A Class For Command Bar

    Thanks Pete, my main goal is to avoid public declaration & encapsulate the function within a class/ form. Typical, spent about 50 hours going through it & find a solution several minutes after posting. Honestly no exaggeration here. I was fixated on the .OnAction property of the button, as it...
  2. D

    Recordset.Requery still showing deleted record

    I wonder if it is ADO procedure. The rs is declared as 'Data Access Object'; so not ADO. But ADO used to be the default format for Access, then they changed it to DAO as the default. It's best to explicitly declare the type; as you have done. There are differences between the two, different...
  3. D

    Solved Encapsulate Function In A Class For Command Bar

    Sorry to bump thread, anyone have a solution to this? Lost nearly a week on it full-time. I've stepped through Mark's code too many times to count. Using Mark's fine code I still get the same error. I cannot gain access to a function assigned to the .OnAction property of the cPopUpBtn from the...
  4. D

    Solved Encapsulate Function In A Class For Command Bar

    Thanks Mark, it's very nice & I spent over an entire weekend playing with it. But my clsBillOrPage is intrinsic to the form & more so my main endeavour is to use the .OnAction property to run different functions; which the entire purpose of classes is to contain what is relevant to that class...
  5. D

    Solved Encapsulate Function In A Class For Command Bar

    Thanks for the rapid response guys, massively appreciated.
  6. D

    Solved Encapsulate Function In A Class For Command Bar

    I have a class for a Subform; trying to encapsulate all relevant things. The MouseUp event (assigned to the class) deletes & builds a relevant right-click context menu. But if I place a Public Function InsertPageFromABill() within the class to handle a button in the Command Bar it is not visible...
  7. D

    Solved Unkown Cls/Collection Holding An Event

    This is more valuable than anything. Understanding best practices & the reasons behind them. Yes I'm most grateful. You've been a massive help yourself also. I received several solutions to my problem here but more importantly you've both helped me to grasp the concept of OOP, which I simply...
  8. D

    Solved Unkown Cls/Collection Holding An Event

    Hey guys don't spend anymore time on this; you've already been too generous. I'm playing around more, getting a better understanding & probably come up with something not puristly correct, but may work. I'll update the thread on how I get on. Things are finally starting to get a bit better...
  9. D

    Solved Unkown Cls/Collection Holding An Event

    Thanks guys, learning a lot. I'm new to classes & this is probably a bit much for me at this early stage but I think if I can get a good understanding of them that's 90% of VBA (OOP) & less likely to come across issues later. It's interesting no matter how much you read you come across issues...
  10. D

    Solved Unkown Cls/Collection Holding An Event

    Thanks Mark, I can't post it online as it's a project I've been working on for 8 months. I'll send you a DM.
  11. D

    Solved Unkown Cls/Collection Holding An Event

    Thanks, I'm becoming quite a nuisance, had problem after problem & been experimenting with it so many times & in different ways. What can cause the collection to die when using the form as a subform? The event fires perpetually (as desired) when viewing the subfrm individually & the collection...
  12. D

    Solved Unkown Cls/Collection Holding An Event

    Agree, it really clicked for me after reading this; a massive help.
  13. D

    Solved Unkown Cls/Collection Holding An Event

    Coolio, to clarify @MajP & @MarkK kindly identified the issue which was not instantiating the cls at each iteration. I've abused their kindness a little (sorry guys) by extending the thread a little & we've gotten into advanced decoupling; which I am extremely grateful for. This goes a massive...
  14. D

    Solved Unkown Cls/Collection Holding An Event

    I didn't spot Containers, so thanks for that. I have a limited understanding so have found the Object Browser to be most confusing; unable to find logic to it. Yes, Objects, Methods, Properties, Classes... but up until recently I've struggled to find the consistency in VBA. This topic is a...
  15. D

    Solved Unkown Cls/Collection Holding An Event

    Yeah I thought I should've put an argument in the first function. So the second function does not create a memory leak because it was a function. It created a declaration space in memory with it's declaration. Then instantiated to that pointer in memory. Then because it was a function it...
  16. D

    Solved Unkown Cls/Collection Holding An Event

    And a function that references itself has not created a new instantiation. It has merely changed the value of the instance of itself: Public Function GetStrategy() As clsStrategy GetStrategy.Load "me (runtime strategy resource) by instantion of clsStrategy" End Function Whereas the below has...
  17. D

    Solved Unkown Cls/Collection Holding An Event

    Thanks Mark, starting to get it I think. If I put the GetStrategy Function in the clsStrategy (EDIT I know it would be better in a global Module so it can be accessed from anywhere but for the interest of experimenting to learn properly), it's creating an instance of itself; a pointer to itself...
  18. D

    Solved Unkown Cls/Collection Holding An Event

    Sorry how does one go about implementing your decoupling in full? I passed a 'cookie' the cTextboxRightClickStrategyHandler, thinking that I'd be able to access the dalsExectute procedure but nope. Frm: Private mDalsObj As cTextboxRightClickStrategyHandler Private mThisParticularStrategy As...
  19. D

    Solved Unkown Cls/Collection Holding An Event

    I'm so grateful, thank you both so much.
  20. D

    Solved Unkown Cls/Collection Holding An Event

    Thanks guys, greatly appreciated. That is strange, I would've thought as there was an instantiation I could've used that. I would've thought setting the value to the new ltBox in the cls fInit would've caused it to reset regardless. In my little mind there's one instance of the cls used in the...
Back
Top Bottom