Private Sub Year_AfterUpdate()
Dim Qdf As DAO.QueryDef
Dim strSQL As String
Set Qdf = CurrentDb.QueryDefs("Q")
strSQL = "SELECT Total.* FROM Total Where format(Year,'yyyy')='" & Me.Year & "'"
Qdf.SQL = strSQL
Me.reference.SourceObject = "查询.Q"
Me.Subform.SourceObject = "查询.Total_Year"
Qdf.Close
Set Qdf = Nothing
End Sub