Recent content by bodders24

  1. B

    Access subform - Current event does not fire on first record selected

    Thanks for your replies. I have found one way round it (sort of). If you select the first x records starting with record x the Current event fires. If you select the first x records starting with the first record it does not fire - but only immediately after the form has been opened. It works on...
  2. B

    Access subform - Current event does not fire on first record selected

    I have an annoying little problem with the following setup. I have a SQL Server back-end database with a Microsoft Access (2019) front-end. One of the Access forms contains a subform which has as its recordsource a pass-through query reading data from the SQL Server back-end. What I want to be...
  3. B

    VBA to read foreign keys in table

    Thanks for your responses. The use of the MSysRelationships table solved the problem.
  4. B

    VBA to read foreign keys in table

    David Thanks for your reply. I had already done this: For Each rln In gdbs.Relations blnSelect = True If InStr(1, rln.Table, "Hol") > 0 Then blnSelect = False End If If Mid(rln.Table, 2, 3) = "Sys" Then blnSelect = False End If If (blnSelect = True) And...
  5. B

    VBA to read foreign keys in table

    I have written some VBA to create a basic data model in Excel from an Access database. It’s nearly there, but I have found an issue with finding the Foreign keys in tables. Here is the relationship: And here are the indexes in table tblSubHeading: When I use the Relation object the VBA...
  6. B

    VBA to add Totals to subform

    CJ - Finally the penny has dropped & I see what you meant. It's all working now - many thanks for your patience & help. Bodders
  7. B

    VBA to add Totals to subform

    As requested here is all the code used to rebuild the table and subform. I *think* the problem is somewhere in the subform properties. Also thanks for all the help and advice so far - it's been very useful The complete code exceeds the character limit for posting here, so here is just the proc...
  8. B

    VBA to add Totals to subform

    How did you set the total cells - manually ?
  9. B

    VBA to add Totals to subform

    This is what I see with the query as the subform SourceObject - a Total row but no totals:
  10. B

    VBA to add Totals to subform

    Thanks for the responses. Having tried everything suggested above, here is the current situation. The query which is the SourceObject for the datasheet subform produces a totals row and individual total rows exactly as it should, using AggregateType = 0. The problem is the subform. I can add...
  11. B

    VBA to add Totals to subform

    Warnings are definitely on
  12. B

    VBA to add Totals to subform

    Changing qdf.Fields(5).Properties("AggregateType") = 0 to qdf.Fields(5).Properties("AggregateType") = acAggregateSum actually produces the wrong answer in the query. It gives the average.
  13. B

    VBA to add Totals to subform

    Here's the query opened on its own with subtotals showing: And here is the subform with the above query as its Recordsource (no totals showing): I cannot work out why this should be.
  14. B

    VBA to add Totals to subform

    Interestingly the query opened on its own has the Total row with the correct values. Only on the subform - opened separately - it does not. Strange
  15. B

    VBA to add Totals to subform

    In other posts I have read using the AggregateType of 0 should produce a Sum total
Back
Top Bottom