Dim d As Date = e.Form.Controls("DateTimePicker1").value Dim dr As DataRow = DataTables("营养素作图统计表").find("日期 = #" & d & "#") If dr Is Nothing Then dr = DataTables("营养素作图统计表").addnew dr("日期") = d End If dr("能量") = DataTables("营养素分析表_临时").Compute("sum(总能量)")