我在BeforeClose事件中写了如下代码,当没有数据存在时关闭窗体时弹出错误对话框:
e.Form.Controls("shanghuruku").Enabled=False
e.Form.Controls("shujudaohang").Enabled= True
e.Form.Controls("shujucaozuo").Enabled=True
e.Form.Controls("quedingxiugai").Enabled= False
e.Form.Controls("quedingxiugai").text="确定修改"
e.Form.Controls("quxiaoxiugai").Enabled=False
e.Form.Controls("xiugaishuju").Enabled=True
e.Form.Controls("tianjiashuju").Enabled=True
Tables("商户资料表").ApplyFilter = False
Tables("商户资料表").Current("客户ID") = e.Form.Controls("kehuIDDropBox").Value
Tables("商户资料表").Current("通道名称") = e.Form.Controls("tongdaomingchengComboBox").Value
Tables("商户资料表").Current("商户名称") = e.Form.Controls("shanghumingchengText").Value
Tables("商户资料表").Current("商户编号") = e.Form.Controls("shanghubianmaTextBox").Value
Tables("商户资料表").Current("法人姓名") = e.Form.Controls("farenxingmingTextBox").Value
Tables("商户资料表").Current("网点名称") = e.Form.Controls("wangdianmingchengtext").Value
Tables("商户资料表").Current("网点地址") = e.Form.Controls("wangdiandizhiText").Value
Tables("商户资料表").Current("网点编号") = e.Form.Controls("wangdianbianhaoText").Value
Tables("商户资料表").Current("商户状态") = e.Form.Controls("shanghuzhuangtaiComboBox").Value
Tables("商户资料表").Current("最后更改日期") = e.Form.Controls("zuihougenggairiqiDateTimePicker").Value
Tables("商户资料表").Current("备注") = e.Form.Controls("beizhuText").Value
DataTables("商户资料表").save
Tables("商户资料表").Filter =""
DataTables("商户资料表").Load
Tables("商户资料表").position = 0

此主题相关图片如下:8965.jpg
[此贴子已经被作者于2017/9/16 8:56:47编辑过]