在“订单”表中用窗口进行录入设计,在同一个GroupBox中设置了两个RadioButton控件和一个TextBox控件,
TextBox1绑定到“订单.订单分类”;
两个RadioButton控件的CheckedChanged事件代码分别设为
RadioButton1:
--------------
Dim rdo As WinForm.RadioButton
rdo = e.Form.Controls("RadioButton1")
If rdo.Checked = True Then
Dim txt1 As WinForm.textbox
txt1 = e.Form.Controls("TextBox1")
txt1.Value = "销售"
End If
RadioButton2:
--------------
Dim rdo As WinForm.RadioButton
rdo = e.Form.Controls("RadioButton2")
If rdo.Checked = True Then
Dim txt1 As WinForm.textbox
txt1 = e.Form.Controls("TextBox1")
txt1.Value = "采购"
End If
在窗口中操作后,窗口中显示extBox1如代码设计,但是“订单”表中的“订单分类”没有数据,
如果不通过RadioButton控件的CheckedChanged事件代码设置extBox1,直接在extBox1进行输入,
数据很好地绑定到“订单”表中的“订单分类”中。
请问老师,这是为什么?该怎么写这段代码?