|
- Private Sub Command1_Click()
- Dim mrc As ADODB.Recordset
- Dim txtsql As String
- If Trim(Combo1.Text) = "" Then
- MsgBox "请选择查询方式"
-
- ElseIf Trim(Combo1.Text) = "销售编号" Then
- If Text1.Text = "" Then
- MsgBox "销售编号不能为空"
- Else
- txtsql = "select Det_id as 销售编号,ProdCode as 商品编号,QtySold as 销售数量,Invoice_NoD as 发票编号 from Invoice_Detail where Det_id='" & Trim(Text1.Text) & "'"
- Call adodc(txtsql, Adodc1, DataGrid1)
- End If
- ElseIf Trim(Combo1.Text) = "商品编号" Then
- If Text1.Text = "" Then
- MsgBox "商品编号不能为空"
- Else
- txtsql = "select Det_id as 销售编号,ProdCode as 商品编号,QtySold as 销售数量,Invoice_NoD as 发票编号 from Invoice_Detail where ProdCode='" & Trim(Text1.Text) & "'"
- Call adodc(txtsql, Adodc1, DataGrid1)
- End If
- End If
- Text1.Text = ""
- End Sub
复制代码 运行程序时弹出错误:“标准表达式中数据类型不匹配”代码如上
|
|