Recent content by bodders24

  1. B

    VBA to read foreign keys in table

    Thanks for your responses. The use of the MSysRelationships table solved the problem.
  2. 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...
  3. 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...
  4. 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
  5. 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...
  6. B

    VBA to add Totals to subform

    How did you set the total cells - manually ?
  7. 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:
  8. 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...
  9. B

    VBA to add Totals to subform

    Warnings are definitely on
  10. 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.
  11. 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.
  12. 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
  13. B

    VBA to add Totals to subform

    In other posts I have read using the AggregateType of 0 should produce a Sum total
  14. B

    VBA to add Totals to subform

    I have built a procedure to dynamically rebuild a subform and underlying table based on a crosstab query. This is so that it can show various combinations of categories (rows) and monthly totals (columns). I would like to have a total row appearing on the form and to use VBA to achieve this. The...
  15. B

    Solved Custom Ribbon images type mismatch error

    That was a quick response and a successful one. Changing Field2 to Field did the trick. Many thanks for that Bodders
Back
Top Bottom