e.Form.Controls("DateTimePicker2").Value= Date.Today.AddDays(0)
'单据已保存状态下,控件状态如下
e.Form.Controls("Button2").Enabled = True
e.Form.Controls("Button4").Enabled = True
e.Form.Controls("Button5").Enabled = True
e.Form.Controls("Button6").Enabled = True
e.Form.Controls("Button1").Enabled = True
e.Form.Controls("Button8").Enabled = False
e.Form.Controls("Button05").Enabled = False
e.Form.Controls("Button11").Enabled = False
e.Form.Controls("Button02").Enabled = False
e.Form.Controls("Button04").Enabled = False
e.Form.Controls("Button01").Enabled = False
'单据已保存且audited状态下,则禁用编辑\删除\保存功能
For Each dr1 As DataRow In DataTables("R03_payable").Select("smartID ='" & smartID & "' ")
If dr1("audited") = True Then
e.Form.Controls("Button01").Enabled = False
e.Form.Controls("Button12").Enabled = False
e.Form.Controls("Button03").Enabled = False
e.Form.Controls("Button06").Enabled = False
e.Form.Controls("Button07").Enabled = True
'若单据已保存且未审核状态下,则开放编辑\删除\保存功能
Else
e.Form.Controls("Button01").Enabled = True
e.Form.Controls("Button12").Enabled = True
e.Form.Controls("Button03").Enabled = False
e.Form.Controls("Button06").Enabled = True
e.Form.Controls("Button07").Enabled = False
End If
Next
以上代码在开发版升级后出现如下报错(未升级前不报错),代码写在窗体的AfterLoad事件,老师帮看下是怎么回事
此主题相关图片如下:1654073263(1).jpg

[此贴子已经被作者于2022/6/1 16:51:07编辑过]