Search results

  1. MarkK

    Solved Unkown Cls/Collection Holding An Event

    Consider a function like... Function GetTaxStrategy(Name As String) As Object Select Case Name Case "CalcOntarioTax": Set GetTaxStrategy = New cTaxEngineON Case "CalcBCTax": Set GetTaxStrategy = New cTaxEngineBC Case "CalcQuebecTax": Set GetTaxStrategy = New cTaxEngineQC...
  2. MarkK

    Solved Unkown Cls/Collection Holding An Event

    Well, your first function will fail because GetStrategy does not exist yet as an instance. In the second function you create an actual instance (using New, which is essential) which is scoped to the function. This returns to the caller, a pointer to the new instance.
  3. MarkK

    Solved Unkown Cls/Collection Holding An Event

    Also note the difference between an instance of an object and a pointer to it. Any variable "containing" an object is actually just pointer to an object, not the object itself. As a result, if you do... Dim col As New VBA.Collection Dim tmp As New cSomeClass Dim i As Integer...
  4. MarkK

    Solved Unkown Cls/Collection Holding An Event

    Not a feeble mind!!! This is hard. Complicated, and not intuitive! So be patient and persistent. See if this sample helps.
  5. MarkK

    Questions to God.

    No matter what you believe, as you walk the path of your own narrative you will find it ends in profound mystery. Reasoning from science confronts the unknowable. Belief in God confronts the unknowable. Possibly, the degree to which you think your own view is worth arguing is directly...
  6. MarkK

    subforms and forms

    Because Form.Parent will raise an error if there is no parent, I commonly write a custom property on a subform as follows... Property Get ParentName() As String On Error Resume Next ParentName = Me.Parent.Name End Property With the presence of such a property, you can now write code on the...
  7. MarkK

    Solved Unkown Cls/Collection Holding An Event

    Remember, a class instance is a discrete and unique object. Your clsDalsTxtBox class is designed as a wrapper around--or container for--a single TextBox. As such, you need a new and different container instance for each different TextBox you wish to contain, and this is why you need a user...
  8. MarkK

    Solved Unkown Cls/Collection Holding An Event

    Your Frm code needs to create a new instance of clsDalsTxtBox inside the loop. Each TextBox should be loaded into a new unique instance. Your code creates only one instance, and then inside the loop keeps replacing the TextBox it contains with the next one. Consider... Private m_col As...
  9. MarkK

    Access Europe User Group - Wed 6 Aug: New and Forthcoming Features in Access (Colin Riddington)

    Colin, my intent is to get more involved, but I blew it this a.m. (I'm GMT -9 so it was 10am), but I grabbed your .ics link so I've got it now in Outlook as a recurring appointment. Hey George, I just joined the Pacific Access User Group.
  10. MarkK

    Import Excel file in Database using VBA (learning purpose)

    Hey @Pat Hartman, best wishes on a complete and speedy recovery! Mark
  11. MarkK

    Access Europe User Group - Wed 6 Aug: New and Forthcoming Features in Access (Colin Riddington)

    Hey @isladogs, are these events recorded and available after-the-fact? If so, can you point me to where they can be found? Thanks, Mark
  12. MarkK

    Merge two tables in query by date/time, preserving hourly time in one of the tables

    Hey @Ken Sheridan, on bigger data sets, would it ever make sense to round the date values numerically, like... SELECT tblFish.*, tblFlow.Fish_Count FROM tblFish LEFT JOIN tblFlow ON ROUND(tblFish.Flow_DateTime, 4) = ROUND(tblFlow.Count_Date_Time, 4); ...so...
  13. MarkK

    Solved Unkown Cls/Collection Holding An Event

    Well, the bigger cost if you leak a WithEvents variable is that it may continue to handle events after its container closes. So maybe you assign the item to a variable on a subform, in which case a valid subform reference is added to the subscriber list of the WE variable. When the mainform...
  14. MarkK

    Solved Getting old :-(

    Except the suggestion getting old is solved is what attracted my attention ITFP, so this solved distinction, if intended to inhibit ramblings-on, is creating a bigger problem.
  15. MarkK

    Solved Getting old :-(

    Exacta-mundo.
  16. MarkK

    Merge two tables in query by date/time, preserving hourly time in one of the tables

    Maybe it is actually a difficult merge? My first suggestion is to post your SQL, because mucking around with what you already have will make it faster to help. What might work is a LEFT JOIN or RIGHT JOIN on the fields relating the tables. You might be using an INNER JOIN, which only returns...
  17. MarkK

    Solved Getting old :-(

    The fact this thread called Getting Old :-( is marked Solved is misleading. IMO.
  18. MarkK

    Solved Unkown Cls/Collection Holding An Event

    This class takes a textbox and a strategy, and on TextBox.RightClick it executes the strategy... Private WithEvents tb_ As Access.TextBox Private stg_ As Object Public Function Init(tb As Access.TextBox, stg As Object) As cTextboxRightClickStrategyHandler Set tb_ = tb Set stg_ = stg Set...
  19. MarkK

    Solved Unkown Cls/Collection Holding An Event

    Your class would make more sense if it encapsulated the HandleRightClickOnBillAndPageF functionality directly, like... Private WithEvents tb_ As Access.TextBox Public Function Init(tb As Access.TextBox) As cTextBoxMouseUpOnBillAndPageFStrategy Set tb_ = tb Set Init = Me End Function...
  20. MarkK

    Solved Unkown Cls/Collection Holding An Event

    The definition of a memory leak is that the objects are no longer accessible in code. The variables they were assigned to on creation no longer exist, but their references with each other are still valid, so garbage collection does not destroy them. You could only find them back from memory if...
Back
Top Bottom