当前位置:编程学习 > VB >>

VB中为什么总是出现过程声明与同名事件或过程的描述不匹配的问题?有用到数据库和ADODC

代码如下:
    Private Sub DataCombo1_Click(Area As Integer)
If Area = 2 Then
Call myQuery
DataGrid1.SetFocus
End If

End Sub

Private Sub DataCombo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call myQuery
End If

End Sub

Sub myQuery()
competitorname = DataCombo1.BoundText
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find ("竞争对手名称='" & competitorname & "'")
If Adodc1.Recordset.EOF Then
MsgBox "未查到指定竞争对手名称", 48, "注意"
Exit Sub
End If
strSQL = "select * from 竞争对手基本情况调查表 where 竞争对手名称='" & Adodc1.Recordset("竞争对手名称") & "'"
Adodc2.RecordSource = strSQL
Adodc2.Refresh
Adodc2.Caption = "记录号:" & Adodc2.Recordset.AbsolutePosition & "/" & Adodc2.Recordset.RecordCount

End Sub

Private Sub Form_Activate()
DataCombo1.BoundText = Adodc1.Recordset("竞争对手名称")
DataGrid1.SetFocus
Call caxun
Adodc1.Visible = False
Label1.Caption = "请选择或输入竞争对手名称"
frmjzjiben.Caption = "竞争对手基本情况调查表"

End Sub

Private Sub Form_Resize()
DataGrid1.Height = Form1.ScaleHeight

End Sub
--------------------编程问答-------------------- 单步调试一下,看一下在那条语句出的错 --------------------编程问答--------------------
Private Sub DataCombo1_Click(Area As Integer) 


DataCombo1是什么控件? --------------------编程问答-------------------- 我以前也出现过这种情况,我当时是由于偷懒,在写字过程时,只改了控件的响应事件的名称,而忘了里面的参数,例如:
Private Sub UpDown3_DownClick(Index As Integer)
而我的Index As Integer的可能写成了别的,不知道你的是不是,可以检查一下 --------------------编程问答-------------------- --------------------编程问答-------------------- --------------------编程问答-------------------- Call caxun 
改为
Call myQuery
因为过程caxun就没出现过。
补充:VB ,  数据库(包含打印,安装,报表)
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,