Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'd like to add here some other questions and answers related in a way or another to the same issue. The pointers might lead to my own answer to these questions, but do not hesitate to browse other's answers!</p> <p><a href="https://stackoverflow.com/questions/469436/ms-access-as-enterprise-software/471785#471785">MS Access as enterprise software</a></p> <p><a href="https://stackoverflow.com/questions/47400/best-way-to-test-a-ms-access-application/70572#70572">Best way to test an MS-Access application</a></p> <p><a href="https://stackoverflow.com/questions/247292/working-with-multiple-programmers-on-ms-access/250852#250852">Working with multiple programmers on MS-Access</a></p> <p><a href="https://stackoverflow.com/questions/393381/recommendations-on-using-sql-server-guid-from-ms-access/393522#393522">Recommendations on using SQL server GUIDS from MS-Access</a></p> <p>I must admit that one of the main constraints of Access is the limited object model. I was specifically annoyed by the lack of possibilities to add my own properties and methods to the Form object. I recently found an efficient turnaround to this problem by creating 2 extra objects:</p> <ul> <li><p>the "AllMyForms" object, which in fact maintain 2 object collections: one is the standard Access forms collection, the other one is a collection of all the instances of the "customForm" object. Both collections are indexed with the hwnd property of an opened form (or, to be more specific, the hwnd property of the instance of a form, allowing me to open multiple instances of the same form).</p></li> <li><p>the "customForm" object, which lists my custom properties and methods of a form's instance</p></li> </ul> <p>In this way, I can refer to properties such as:</p> <p><strong>accessForms:referring to the standard properties and methods</strong></p> <pre><code>AllMyForms.accessForm(hwnd).name </code></pre> <p>refers to the .name property of the access form through its .hwnd value</p> <p>By the way, the following debug.print will then give me the same result:</p> <pre><code>? screen.ActiveForm.name ? AllMyForms.accessForm().name 'default value for hwnd is screen.activeForm.hwnd' </code></pre> <p><strong>Custom forms:properties</strong></p> <pre><code>AllMyForms.customForm(hwnd).selectClause </code></pre> <p>will refer to the SELECT clause used to create the underlying recordset of the form's instance</p> <p><strong>Custom forms:methods</strong></p> <p>The .agregate method, available for a customForm object, will calculate the sum/min/max/avg of a form "column" (ie sum of values for a control in a continuous form):</p> <pre><code>AllMyForms.customForm().agregate("lineAmount","sum") </code></pre> <p>Will give me the sum of all "lineAmount" values displayed on the current/active instance of a form.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload