VB错误提示标准表达式中数据类型不匹配是什么原因呢?
PrivateSubCommand1_Click()cnn.OpenIfText2.Text=""OrText1.Text=""ThenMsgBox"输入的借出信息不完全...
Private Sub Command1_Click()
cnn.Open
If Text2.Text = "" Or Text1.Text = "" Then
MsgBox "输入的借出信息不完全!", vbCritical
Else
If Text2.Text > Text5.Text Then
MsgBox "借用数量不能大于可借数量!", vbCritical
Else
Adodc1.RecordSource = "select * from tb_jcsb where (tb_jcsb.设备名称='" & Text11.Text & "' and tb_jcsb.借用人='" & Text1.Text & "' and tb_jcsb.借出日期='" & DT1.Value & "' and tb_jcsb.应还日期='" & DT2.Value & "')"
Adodc1.Refresh →(在这里提示标准表达式中数据类型不匹配)
If Adodc1.Recordset.RecordCount > 0 Then
MsgBox "该借用人在该日已借用过该设备,若要更改借用信息,请点击续借管理进行设置!", vbInformation
Else
Adodc3.RecordSource = "select * from tb_cxsb where 设备名称='" & Text11.Text & " '"
Adodc3.Refresh
cnn.Execute ("insert into tb_jcsb values('" & Text4.Text & "','" & Text11.Text & "','" & Text3.Text & "','" & Text1.Text & "','" & Text2.Text & "','" & DT1.Value & "',' " & DT2.Value & " ')")
y = Val(Adodc3.Recordset.Fields("可借数量")) - Text2.Text
hs2 = "update tb_cxsb set 可借数量='" & y & "' where 设备名称='" & Text11.Text & "'"
cnn.Execute (hs2)
jcsb1.Adodc3.Refresh
MsgBox "借出完毕!", vbOKOnly
Unload Me
End If
End If
End If
cnn.Close
End Sub
求解啊。。。。 展开
cnn.Open
If Text2.Text = "" Or Text1.Text = "" Then
MsgBox "输入的借出信息不完全!", vbCritical
Else
If Text2.Text > Text5.Text Then
MsgBox "借用数量不能大于可借数量!", vbCritical
Else
Adodc1.RecordSource = "select * from tb_jcsb where (tb_jcsb.设备名称='" & Text11.Text & "' and tb_jcsb.借用人='" & Text1.Text & "' and tb_jcsb.借出日期='" & DT1.Value & "' and tb_jcsb.应还日期='" & DT2.Value & "')"
Adodc1.Refresh →(在这里提示标准表达式中数据类型不匹配)
If Adodc1.Recordset.RecordCount > 0 Then
MsgBox "该借用人在该日已借用过该设备,若要更改借用信息,请点击续借管理进行设置!", vbInformation
Else
Adodc3.RecordSource = "select * from tb_cxsb where 设备名称='" & Text11.Text & " '"
Adodc3.Refresh
cnn.Execute ("insert into tb_jcsb values('" & Text4.Text & "','" & Text11.Text & "','" & Text3.Text & "','" & Text1.Text & "','" & Text2.Text & "','" & DT1.Value & "',' " & DT2.Value & " ')")
y = Val(Adodc3.Recordset.Fields("可借数量")) - Text2.Text
hs2 = "update tb_cxsb set 可借数量='" & y & "' where 设备名称='" & Text11.Text & "'"
cnn.Execute (hs2)
jcsb1.Adodc3.Refresh
MsgBox "借出完毕!", vbOKOnly
Unload Me
End If
End If
End If
cnn.Close
End Sub
求解啊。。。。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询