If e.form.Controls("ComboBox1").Value Is Nothing Then
MsgBox("请选择患者住院号!",64,"提示")
ElseIf e.form.Controls("DateTimePicker1").Value Is Nothing Then
Dim r As Row = CurrentTable.AddNew
r("住院号") =Forms("长期医嘱").Controls("ComboBox1").value.split(":")(2)
r("开嘱日期") =Date.Today
r("医生") =Forms("长期医嘱").Controls("ComboBox5").value
Else
Dim r As Row = CurrentTable.AddNew
r("住院号") =Forms("长期医嘱").Controls("ComboBox1").value.split(":")(2)
r("开嘱日期") =Forms("长期医嘱").Controls("DateTimePicker1").value
r("医生") =Forms("长期医嘱").Controls("ComboBox5").value
End If
另外建议代码中少用Forms("表名"),用e.form,原因参考:
http://www.foxtable.net/help/topics/1854.htm