Sub test() On Error Resume Next '适用于07及以上版本 Dim qrydef As Object Set qrydef = CurrentDb.QueryDefs("查询5") qrydef.Properties("TotalsRow") = True End Sub