假如一组数据(电话1、电话2、电话3)是正常显示 、另一组对应的数据(电话1掩码显示、电话2掩码显示、电话3掩码显示)收是掩码显示 ,当登录程序的身份为操作员的时候,打开组合框显示的是掩码显示,当单击某一项的时候选值是正常显示的字段去给数据库另一表赋值,怎么设置一下呢?因为在 DataColChanging事件中写了如下代码
If e.DataCol.name ="注册手机号掩码" Then
If e.NewValue = "" Then
systemready = False
e.DataRow(e.DataCol.name.SubString(0,e.DataCol.name.length-4)) = ""
systemready = True
ElseIf e.newvalue.contains("*") = False Then
Dim r_tele As New System.Text.RegularExpressions.Regex("^1[0-9]{10}$")
If r_tele.IsMatch(e.newvalue) = False Then
msgbox("电话号码不正确")
e.cancel = True
End If
If e.Cancel = False Then
systemready = False
e.DataRow(e.DataCol.name.SubString(0,e.DataCol.name.length-2)) = e.newvalue
e.NewValue = e.NewValue.SubString(0, 3) & "*****" & e.NewValue.SubString(8,3)
systemready = True
End If
Else
msgbox("不能这样修改")
e.cancel = True
End If
End If
在组合框的Enter事件中写了如下代码
Dim khID As WinForm.DropDownBox= e.Form.controls("kehuIDDropBox")
Dim zcsjh As WinForm.ComboBox=e.Form.Controls("zhuceshoujihaoComboBox")
Dim dr As DataRow
If khID.text<>"" Then
dr = DataTables("客户资料").Find("客户ID= '"& khID.text &"'")
Dim zfc As String=dr("手机号1") & "|" & dr("手机号2") & "|" & dr("手机号3")
Dim zfc1 As String=dr("手机号1掩码") & "|" & dr("手机号2掩码") & "|" & dr("手机号3掩码")
If _UserGroup <> "系统管理员" Then
zcsjh.BindingField = "商户资料表.注册手机号掩码"
zcsjh.ComboList=zfc1
Else
'zfc =dr("手机号1") & "|" & dr("手机号2") & "|" & dr("手机号3")
zcsjh.BindingField = "商户资料表.注册手机号"
zcsjh.ComboList=zfc
End If
End If
如果不照样选择就会报错的。.提醒 "不能这样修改"
[此贴子已经被作者于2019/7/26 20:11:46编辑过]