子窗体不显示在窗体视图中

时间:2017-04-24 10:47:14

标签: sql ms-access subform table-relationships

我有一个从包含计算字段的查询派生的子表单。它不会在表单视图中显示。我已经设置了主要和子级字段链接以及我的“允许添加”#39;属性设置为yes。我发现的原因之一是“表格基于没有记录的表格。”#39;情况如此。它当然是一对多关系,子表格是多方面的表格。

以下是查询:

SELECT [Management Accounting table].Date_To_Budgets,
       [Management Accounting table].Date_Returned_To_SCM, 
       [Management Accounting table].Date_To_Assets, 
       [Management Accounting table].Date_Returned_From_Assets, 
       [Management Accounting table].Select_Fund, 
       [Management Accounting table].Project, 
       [Management Accounting table].Select_SubProgramme, 
       [Management Accounting table].Cost_Centre, 
       [Management Accounting table].Item, 
       [Management Accounting table].Supplier, 
       [Management Accounting table].Amount, 
       Sum([Management Accounting table].Amount) AS [Total Amount], 
       SLD_Number
       FROM [Management Accounting table]
       GROUP BY [Management Accounting table].Date_To_Budgets, 
                [Management Accounting table].Date_Returned_To_SCM, 
                [Management Accounting table].Date_To_Assets,
                [Management Accounting table].Date_Returned_From_Assets, 
                [Management Accounting table].Select_Fund,
                [Management Accounting table].Project,
                [Management Accounting table].Select_SubProgramme, 
                [Management Accounting table].Cost_Centre, 
                [Management Accounting table].Item, 
                [Management Accounting table].Supplier, 
                [Management Accounting table].Amount,
                SLD_Number;

1 个答案:

答案 0 :(得分:1)

根据定义,GROUP BY的查询是只读的。参见例如here

所以'允许添加'并不重要。 property设置为yes - 您无法根据此查询将数据输入子表单。

=>如果查询没有显示任何记录,则子表单将完全为空。