[求助]麻烦哪位高手能帮我把这个程序解释一下
Private m_oRS As New ADODB.RecordsetPrivate m_bSelect As Boolean
Private m_lID As Long
Private m_oPerRS As Recordset
Private m_strWhere As String
Private m_lSPCID As Long
Private strSql As String
Private get_lPerID As Long
Private strPerName As String
Private Sub cmbType_Click()
Dim rst As New Recordset
With rst
.Open "SELECT * FROM MST_ExpItem", g_Conn, adOpenStatic, adLockReadOnly
.Find "Item = '" & cmbType.text & "'"
If Not .EOF Then
Text1 = fncCVb(.Fields("ItemCode").Value)
End If
.Close
End With
Set rst = Nothing
cmbType2.Clear
Text2 = ""
If Text1.text <> "" Then
With rst
.Open "SELECT DISTINCT ExpCode, Exp, ItemCode FROM MST_ExpItem WHERE ItemCode = " & Text1.text & " Order By ExpCode", g_Conn, adOpenStatic, adLockReadOnly
Do While Not .EOF
If Not IsNull(.Fields("Exp")) Then cmbType2.AddItem .Fields("Exp")
.MoveNext
Loop
.Close
End With
Set rst = Nothing
Else
With rst
.Open "SELECT DISTINCT ExpCode, Exp From MST_ExpItem ORDER BY ExpCode", g_Conn, adOpenStatic, adLockReadOnly
Do While Not .EOF
If Not IsNull(.Fields("Exp")) Then cmbType2.AddItem .Fields("Exp")
.MoveNext
Loop
.Close
End With
Set rst = Nothing
End If
End Sub
麻烦哪位高手帮我解释一下这个程序,谢谢了,刚刚开始学习好多不懂的