Search results

  1. RonPaii

    Class Factories - Parameterized Object Initialisation

    With pre-declare true you test code needs no define. Sub testImplementClass() With cSomething.Create(5, "Quack") Debug.Print .Bar End With End Sub With a single class, interface makes little sense but multiple classes implementing the same interface allow you to some interesting...
  2. RonPaii

    Class Factories - Parameterized Object Initialisation

    I think you missed a step in the tutorial. To add the attribute, you must export the class module to a text file, then open it in a text editor like Notepad, add the attribute text. then import the text file back into your database. The attribute creates an instance of the class when you FE runs...
  3. RonPaii

    Class Factories - Parameterized Object Initialisation

    In cISomethingFactory you define get properties for Bar and Ducky which are not needed, you can comment them out. in cSomething you are retuning the wrong type. 'Private Property Get cISomething_Ducky() As Long Private Property Get cISomething_Ducky() As String cISomething_Ducky = Ducky End...
  4. RonPaii

    Class Factories - Parameterized Object Initialisation

    Since you defined the interface class "cISomething", shouldn't the implementation functions have that name. Private Property Get cISomething_Bar() As Long ISomething_Bar = Bar End Property Private Property Get cISomething_Ducky() As Long ISomething_Ducky = Ducky End Property IMO The...
  5. RonPaii

    The "Magic Roundabout"

    Wisconsin has fell in love with roundabouts.
  6. RonPaii

    Programmatically construct a constant's name and return its value

    Constants are converted to literal values before execution so don't exist for eval to calculate. Const One as Long = 1 Const Two as Long = 2 If myValue = ONE + TWO then is converted to If myValue = 3 then
  7. RonPaii

    A Function that returns a Recordset

    I have looked at your sample DB, VERY IMPRESIVE. The 2 samples I supplied were to more simply show both recursive and non-recursive methods that are easer to follow. The Northwind sample was based on my production contact form which I developed before your sample. Most users click the search...
  8. RonPaii

    A Function that returns a Recordset

    What he said. Anytime you use recursion, add a level counter or something to detect infinite loops. Look at your data for errors in child/parent links.
  9. RonPaii

    A Function that returns a Recordset

    I previously posted sample databases using tree controls. Multi-value field (MVF) using tree control - fills the tree using recursion, it's easy to follow in the debugger because of the limited data. See TreeFillAvailable function in Form_MVF_Control_Tree form. This 2nd attached ACCDB works...
  10. RonPaii

    A Function that returns a Recordset

    For a generic lookup the class will still work, you will need to provide more information. With AnyTableClass .QueryToOpen = "Your Named Query" .ParmName = "Your ID lookup Parameter" .LookupID = YourKeyValue Description = nz(.ColumnFromRS(1)) Location = nz(.ColumnFromRS(2)) End With Option...
  11. RonPaii

    A Function that returns a Recordset

    I agree this would be over kill for one off lookup of a single column. The OP indicated repeated lookups for multiple columns and the possibility of keeping a recordset open to do it. Assuming this is part of a single function call, initiating the class once and using it repeatedly for each...
  12. RonPaii

    A Function that returns a Recordset

    Simpler and faster then a bunch of dLookups. Option Compare Database Option Explicit ' Sample Class to search recordset and return values Private Type MyTableType qd As DAO.QueryDef rs As DAO.Recordset End Type Private This As MyTableType Private Sub Class_Initialize() ' Do...
  13. RonPaii

    MS Access VS MSQL Server

    Any server backend support by Access will work, but may be slower than a "Access" BE depending on how the FE was coded i.e. opening a form linked to a table without a filter. The corruption issue on WAN is only with an "Access" BE.
  14. RonPaii

    A Function that returns a Recordset

    If you are filling variables from table columns like the following Description = MyTableDesc(LookUpID) Location= MyTableLocation(LookUpID) .. SomeOtherField = MyTableSomeOtherField(LookUpID) Consider using a class to fill and return values from your query. With New MyTableClass .LookupID =...
  15. RonPaii

    Variable assignment not working.

    Have you confirmed the RegKey exists on the computers with the problem?
  16. RonPaii

    Solved Using ACCESS, WORD and OUTLOOK to send bulk E-Mails

    New Outlook does NOT support COM automation. You will need to revert to old Outlook for use something else like Microsoft Graph. Your code snip is using late binding, so checking "Microsoft Outlook 16.0 Object Library" does nothing for your code. It may also be the source of your error if using...
  17. RonPaii

    Class_Terminate() on project reset?

    Easy to test. Class1 Private Sub Class_Initialize() Debug.Print "Class_Initialize" End Sub Private Sub Class_Terminate() Debug.Print "Class_Terminate" End Sub Module1 Public Sub Test() With New Class1 Debug.Print "Module1 Test" End With End Sub Normal run test...
  18. RonPaii

    Where and what were you doing on 9/11/2001?

    I was at work. One of office managers pulled up the new feed after the 1st hit. It was very strange how quite it was outside with no air traffic overhead.
  19. RonPaii

    Solved Select Query on 10k or Seek on Millions Faster?

    Add 2 more test where the recordset is not recreated in the loop, required 10,000 searches to see a difference. Note: it the previous test I neglected to user dbOpenTable on the seek recordset, which is requited. Select time: 15 Seconds, Found: 1000 Select Parm time: 13 Seconds, Found: 1000...
Back
Top Bottom