Dim txt As String= e.sender.Text
Dim dtp1 As WinForm.DateTimePicker= e.Form.Controls("DateTimePicker1")
Dim dtp2 As WinForm.DateTimePicker= e.Form.Controls("DateTimePicker2")
If txt="住院患者" Then
If e.Form.Controls("Rdo_dengji").Checked = True
If dtp1.value= Nothing Then
If dtp2.value=Nothing Then
e.Form.Controls("Table5").Table.Filter="情况说明='已入院'"
Else
e.Form.Controls("Table5").Table.Filter="情况说明='已入院'" & "登记日期< #" & dtp2.value & "#"
End If
Else
If dtp2.value=Nothing Then
e.Form.Controls("Table5").Table.Filter="情况说明='已入院'" & "登记日期> #" & dtp1.value & "#"
Else
If dtp1.value>dtp2.value Then
MessageBox.Show("统计开始时间不能晚于统计截止时间,请重新填写统计开始时间或截止时间","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Return
Else
e.Form.Controls("Table5").Table.Filter="情况说明='已入院'" & "登记日期> #" & dtp1.value & "#" & "登记日期< #" & dtp2.value & "#"
End If
End If
End If
End If
If e.Form.Controls("Rdo_ruyuan").Checked = True
If dtp1.value= Nothing Then
If dtp2.value=Nothing Then
e.Form.Controls("Table5").Table.Filter="情况说明='已入院'"
Else
e.Form.Controls("Table5").Table.Filter="情况说明='已入院'" & "预约日期< #" & dtp2.value & "#"
End If
Else
If dtp2.value=Nothing Then
e.Form.Controls("Table5").Table.Filter="情况说明='已入院'" & "预约日期> #" & dtp1.value & "#"
Else
If dtp1.value>dtp2.value Then
MessageBox.Show("统计开始时间不能晚于统计截止时间,请重新填写统计开始时间或截止时间","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Return
Else
e.Form.Controls("Table5").Table.Filter="情况说明='已入院'" & "预约日期> #" & dtp1.value & "#" & "预约日期< #" & dtp2.value & "#"
End If
End If
End If
End If
Else
If e.Form.Controls("Rdo_dengji").Checked = True
If dtp1.value= Nothing Then
If dtp2.value=Nothing Then
e.Form.Controls("Table5").Table.Filter=""
Else
e.Form.Controls("Table5").Table.Filter="登记日期< #" & dtp2.value & "#"
End If
Else
If dtp2.value=Nothing Then
e.Form.Controls("Table5").Table.Filter="登记日期> #" & dtp1.value & "#"
Else
If dtp1.value>dtp2.value Then
MessageBox.Show("统计开始时间不能晚于统计截止时间,请重新填写统计开始时间或截止时间","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Return
Else
e.Form.Controls("Table5").Table.Filter="登记日期> #" & dtp1.value & "#" & "登记日期< #" & dtp2.value & "#"
End If
End If
End If
End If
If e.Form.Controls("Rdo_ruyuan").Checked = True
If dtp1.value= Nothing Then
If dtp2.value=Nothing Then
e.Form.Controls("Table5").Table.Filter=""
Else
e.Form.Controls("Table5").Table.Filter="预约日期< #" & dtp2.value & "#"
End If
Else
If dtp2.value=Nothing Then
e.Form.Controls("Table5").Table.Filter="预约日期> #" & dtp1.value & "#"
Else
If dtp1.value>dtp2.value Then
MessageBox.Show("统计开始时间不能晚于统计截止时间,请重新填写统计开始时间或截止时间","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning)
Return
Else
e.Form.Controls("Table5").Table.Filter="预约日期> #" & dtp1.value & "#" & "预约日期< #" & dtp2.value & "#"
End If
End If
End If
End If