Combolbox的GotFocus问题
我想要实现的功能是:当选定某一系别时,就把该系别对应的专业列出来。我写的代码时这样,但是,总是提示“.MoveFirst”有错,请问,我该怎么修改呀。求救! ^_^
Private Sub xibie_GotFocus()
connstring = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=TechingSys;Data Source=7959F377B73945B"
If conn.State <> 1 Then
conn.Open (connstring)
End If
Set rs = conn.Execute("select SpecializationName from DicSpecialization where DepartmentCode=(select DepartmentCode from DicDepartment where DepartmentName='&Trim(c1.text)&')")
With rs
.MoveFirst
Do While Not .EOF
zhuanye.AddItem (!Specialization)
.MoveNext
Loop
End With
End Sub --------------------编程问答-------------------- 這個地方的錯誤,應該是 eof and bof 了,做一下判斷。
Private Sub xibie_OnClick()
end sub
Private Sub xibie_Click()
end sub --------------------编程问答-------------------- 路过... --------------------编程问答-------------------- If Not .EOF Then .MoveFirst
补充:VB , 控件