老师,你好,还是接之前的问题
控件A为ComboBox组合框在未选取列表数据时,控件B的可见属性为Flase,控件C(日期时间型)没有绑定列表A任何列。控件A在选取列表数据a后,控件B的可见属性变为true,同时控件C绑定表A的第一列(日期时间型)。
现在控件A和控件B之间的能实现,但是控件A和控件C之间的还是没弄成功,我想实现的是ComboBox组合框在选取不同数据时,DataTimePicker13和DataTimePicker16两个日期控件可以实现给表LOA不同的日期列录入数据。
请帮忙看一下代码,保存的时候一直显示编译错误:Property 'Item'is 'Readonly'. 错误代码: e.Form.controls("DataTimePicker13") = e.DataTable(LOA).DataRow("年休假_开始日期")
检查了我的控件没有设为只读状态,表LOA只在表属性PrepareEdit里有一段代码不能编辑表格的代码e.cancel = true
麻烦大神帮看看
Dim b As String = e.sender.text > ""
If b = "年休假" Then
e.Form.controls("DataTimePicker13")=e.DataTable(LOA).DataRow("年休假_开始日期")
e.Form.controls("DataTimePicker16")=e.DataTable(LOA).DataRow("年休假_结束日期")
End If
If b = "探亲假" Then
e.Form.controls("DataTimePicker13")=e.DataTable(LOA).DataRow("探亲假_开始日期")
e.Form.controls("DataTimePicker16")=e.DataTable(LOA).DataRow("探亲假_结束日期")
End If
If b = "婚假" Then
e.Form.controls("DataTimePicker13")=e.DataTable(LOA).DataRow("婚假_开始日期")
e.Form.controls("DataTimePicker16")=e.DataTable(LOA).DataRow("婚假_结束日期")
End If
If b = "产假" Then
e.Form.controls("DataTimePicker13")=e.DataTable(LOA).DataRow("产假_开始日期")
e.Form.controls("DataTimePicker16")=e.DataTable(LOA).DataRow("产假_结束日期")
End If
If b = "陪产假" Then
e.Form.controls("DataTimePicker13")=e.DataTable(LOA).DataRow("陪产假_开始日期")
e.Form.controls("DataTimePicker16")=e.DataTable(LOA).DataRow("陪产假_结束日期")
End If
If e.sender.text > "产假" Then
e.Form.controls("CheckedComboBox1").visible = False
Else
e.Form.controls("CheckedComboBox1").visible = True
End If
e.Form.Controls("Label48").visible = e.Form.Controls("ComboBox17").Text = "年休假"
e.Form.Controls("Label49").visible = e.Form.Controls("ComboBox17").Text = "探亲假"
e.Form.Controls("Label50").visible = e.Form.Controls("ComboBox17").Text = "婚假"
e.Form.Controls("Label51").visible = e.Form.Controls("ComboBox17").Text = "产假"
e.Form.Controls("Label52").visible = e.Form.Controls("ComboBox17").Text = "陪产假"