在线等待,VB添加数据保存到数据库中
PrivateSubcmd_Click()IfCombo3.Text=""ThenMsgBox("*为必填内容")ElseWithfrm_xxxg.Adodc1.Reco...
Private Sub cmd_Click()
If Combo3.Text = "" Then
MsgBox ("*为必填内容")
Else
With frm_xxxg.Adodc1
.Recordset.AddNew
.Recordset("来电时间").Value = Trim(DTP1.Value)
.Recordset("公司名称").Value = Trim(Text1.Text)
.Recordset("客户区域").Value = Trim(Text2.Text)
.Recordset("联系人").Value = Trim(Text3.Text)
.Recordset("联系电话/传真").Value = Trim(Text4.Text)
.Recordset("产品").Value = Trim(Text5.Text)
.Recordset("认证类型").Value = Trim(Text6.Text)
.Recordset("客户问题").Value = Trim(Text7.Text)
.Recordset("销售代表").Value = Trim(Combo1.Text)
.Recordset("跟踪进展").Value = Trim(Text8.Text)
.Recordset("当时回复").Value = Trim(Combo2.Text)
.Recordset("业务部门").Value = Trim(Combo3.Text)
.Recordset("客户分类").Value = Trim(Combo4.Text)
.Recordset("报价人").Value = Trim(Combo5.Text)
.Recordset("报价时效").Value = Trim(Combo6.Text)
If Check1.Value = Checked Then
.Recordset("下次联系时间").Value = Trim(DTP2.Value)
Else
DTP2.Enabled = False
End If
.Recordset("备注跟踪情况").Value = Trim(Text9.Text)
.Recordset("最终结果").Value = Trim(Text10.Text)
.Recordset("原因分析").Value = Trim(Text11.Text)
.Recordset("改进建议").Value = Trim(Text12.Text)
.Recordset("备注").Value = Trim(Text13.Text)
.Recordset.Update
End With
frm_xxxg.Adodc1.Refresh
frm_xxxg.Adodc1.Refresh
MsgBox "添加成功!"
End If
End Sub
Adodc1.ConnectionString = adoCon
Adodc1.RecordSource = "select * from khgl"
Adodc1.Refresh
添加提示“91错误!” 展开
If Combo3.Text = "" Then
MsgBox ("*为必填内容")
Else
With frm_xxxg.Adodc1
.Recordset.AddNew
.Recordset("来电时间").Value = Trim(DTP1.Value)
.Recordset("公司名称").Value = Trim(Text1.Text)
.Recordset("客户区域").Value = Trim(Text2.Text)
.Recordset("联系人").Value = Trim(Text3.Text)
.Recordset("联系电话/传真").Value = Trim(Text4.Text)
.Recordset("产品").Value = Trim(Text5.Text)
.Recordset("认证类型").Value = Trim(Text6.Text)
.Recordset("客户问题").Value = Trim(Text7.Text)
.Recordset("销售代表").Value = Trim(Combo1.Text)
.Recordset("跟踪进展").Value = Trim(Text8.Text)
.Recordset("当时回复").Value = Trim(Combo2.Text)
.Recordset("业务部门").Value = Trim(Combo3.Text)
.Recordset("客户分类").Value = Trim(Combo4.Text)
.Recordset("报价人").Value = Trim(Combo5.Text)
.Recordset("报价时效").Value = Trim(Combo6.Text)
If Check1.Value = Checked Then
.Recordset("下次联系时间").Value = Trim(DTP2.Value)
Else
DTP2.Enabled = False
End If
.Recordset("备注跟踪情况").Value = Trim(Text9.Text)
.Recordset("最终结果").Value = Trim(Text10.Text)
.Recordset("原因分析").Value = Trim(Text11.Text)
.Recordset("改进建议").Value = Trim(Text12.Text)
.Recordset("备注").Value = Trim(Text13.Text)
.Recordset.Update
End With
frm_xxxg.Adodc1.Refresh
frm_xxxg.Adodc1.Refresh
MsgBox "添加成功!"
End If
End Sub
Adodc1.ConnectionString = adoCon
Adodc1.RecordSource = "select * from khgl"
Adodc1.Refresh
添加提示“91错误!” 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询