关于VB中DTPicker控件,再添加过程中点取消,为什么日期DTPicker控件,老出错,代码如下,怎么修改??? 30
PrivateSubCommand1_Click()DimAAsIntegerA=MsgBox("你确定要添加吗?",52,添加成功)IfA=6ThenAdodc1.Re...
Private Sub Command1_Click()
Dim A As Integer
A = MsgBox("你确定要添加吗?", 52, 添加成功)
If A = 6 Then
Adodc1.Recordset.AddNew
Adodc1.Recordset("编号") = Text2(0).Text
Adodc1.Recordset("姓名") = Text2(1).Text
Adodc1.Recordset("性别") = Combo1.Text
Adodc1.Recordset("出生日期") = DTPicker1.Value
Adodc1.Recordset("婚姻状况") = Combo2.Text
Adodc1.Recordset("民族") = Combo7.Text
Adodc1.Recordset("政治面貌") = Combo3.Text
Adodc1.Recordset("转正日期") = DTPicker2.Value
Adodc1.Recordset("籍贯") = Text2(6).Text
Adodc1.Recordset("电话") = Text2(7).Text
Adodc1.Recordset("联系地址") = Text2(9).Text
Adodc1.Recordset("部门") = Combo4.Text
Adodc1.Recordset("职位") = Text2(11).Text
Adodc1.Recordset("职称") = Text2(12).Text
Adodc1.Recordset("专业") = Text2(16).Text
Adodc1.Recordset("聘用形式") = Combo5.Text
Adodc1.Recordset("学历") = Combo8.Text
Adodc1.Recordset("基本工资") = Text2(13).Text
Adodc1.Recordset("在职状态") = Combo6.Text
Adodc1.Recordset("入职日期") = DTPicker3.Value
Adodc1.Recordset.Update
End If
End Sub
Private Sub Command2_Click()
Text2(0).Text = " "
Text2(1).Text = " "
DTPicker1.Value = " "
Combo1.Text = " "
Combo7.Text = " "
Combo3.Text = " "
DTPicker1.Value = " "
Text2(6).Text = " "
Text2(7).Text = " "
Text2(9).Text = " "
Combo4.Text = " "
Text2(11).Text = " "
Text2(12).Text = " "
Text2(16).Text = " "
Combo5.Text = " "
Combo8.Text = " "
Text2(13).Text = " "
Combo6.Text = " "
DTPicker3.Value = " "
Combo1.Text = " "
End Sub 展开
Dim A As Integer
A = MsgBox("你确定要添加吗?", 52, 添加成功)
If A = 6 Then
Adodc1.Recordset.AddNew
Adodc1.Recordset("编号") = Text2(0).Text
Adodc1.Recordset("姓名") = Text2(1).Text
Adodc1.Recordset("性别") = Combo1.Text
Adodc1.Recordset("出生日期") = DTPicker1.Value
Adodc1.Recordset("婚姻状况") = Combo2.Text
Adodc1.Recordset("民族") = Combo7.Text
Adodc1.Recordset("政治面貌") = Combo3.Text
Adodc1.Recordset("转正日期") = DTPicker2.Value
Adodc1.Recordset("籍贯") = Text2(6).Text
Adodc1.Recordset("电话") = Text2(7).Text
Adodc1.Recordset("联系地址") = Text2(9).Text
Adodc1.Recordset("部门") = Combo4.Text
Adodc1.Recordset("职位") = Text2(11).Text
Adodc1.Recordset("职称") = Text2(12).Text
Adodc1.Recordset("专业") = Text2(16).Text
Adodc1.Recordset("聘用形式") = Combo5.Text
Adodc1.Recordset("学历") = Combo8.Text
Adodc1.Recordset("基本工资") = Text2(13).Text
Adodc1.Recordset("在职状态") = Combo6.Text
Adodc1.Recordset("入职日期") = DTPicker3.Value
Adodc1.Recordset.Update
End If
End Sub
Private Sub Command2_Click()
Text2(0).Text = " "
Text2(1).Text = " "
DTPicker1.Value = " "
Combo1.Text = " "
Combo7.Text = " "
Combo3.Text = " "
DTPicker1.Value = " "
Text2(6).Text = " "
Text2(7).Text = " "
Text2(9).Text = " "
Combo4.Text = " "
Text2(11).Text = " "
Text2(12).Text = " "
Text2(16).Text = " "
Combo5.Text = " "
Combo8.Text = " "
Text2(13).Text = " "
Combo6.Text = " "
DTPicker3.Value = " "
Combo1.Text = " "
End Sub 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询