[求助]各位大神帮忙看看,提示引用的未设置到对象实例 Post By:2015/6/21 20:12:00 [显示全部帖子]
If e.Form.Controls("品号").text="" Then MessageBox.Show("物料编号不能为空") Else If e.Form.controls("助记码").text="" Then messageBox.show("助记码不能为空") Else If e.form.controls("品名").text="" Then messageBox.show("物料名称不能为空") Else If e.form.controls("主要仓库").text="" Then messagebox.show("主要仓库不能为空") Else If e.Form.controls("主供货商").text="" Then messagebox.show("主供应商不能为空") Else Dim cr As Row = Tables("品号信息").current If Tables("品号信息").current.Locked = False Then cr("品号")=e.ForM.controls("品号").text cr("品名")=e.ForM.controls("品名").text cr("助记码")=e.ForM.controls("助记码").text cr("主要仓库")=e.ForM.controls("主要仓库").text cr("主供货商")=e.Form.controls("主供货商") cr.Locked=True e.Form.Controls("品号").text="" e.Form.Controls("品名").text="" e.Form.Controls("助记码").text="" e.Form.Controls("主要仓库").text="" e.Form.Controls("主供货商").text="" e.Form.Controls("品号").ReadOnly = BooleanEnum.True e.Form.Controls("品名").ReadOnly = BooleanEnum.True e.Form.Controls("助记码").ReadOnly = BooleanEnum.True e.Form.Controls("主要仓库").ReadOnly = BooleanEnum.True e.Form.controls("主供货商").ReadOnly = BooleanEnum.True Else Dim nr As Row = Tables("品号信息").AddNew nr("品号")=e.ForM.controls("品号").text nr("品名")=e.ForM.controls("品名").text nr("助记码")=e.ForM.controls("助记码").text nr("主要仓库")=e.ForM.controls("主要仓库").text nr("主供货商")=e.Form.controls("主供货商").text e.Form.Controls("品号").text="" e.Form.Controls("品名").text="" e.Form.Controls("助记码").text="" e.Form.Controls("主要仓库").text="" e.Form.controls("主供货商").text="" e.Form.Controls("品号").ReadOnly = BooleanEnum.True e.Form.Controls("品名").ReadOnly = BooleanEnum.True e.Form.Controls("助记码").ReadOnly = BooleanEnum.True e.Form.Controls("主要仓库").ReadOnly = BooleanEnum.True e.Form.controls("主供货商").ReadOnly = BooleanEnum.True nr.Locked = True End If End If End If End If End If