这样?
Dim dd As String = e.Form.Controls("工序班组").ValueIf dd IsNot Nothing Then e.Form.Controls("日期").Value = DataTables("日报表").Compute("Max(日期)", "[工序_班组] = '" & dd & "'")Else e.Form.Controls("日期").Value = DataTables("日报表").Compute("Max(日期)")End If