我是VBA的新手,我必须了解别人编写的代码。这是她为变量设置的:
Sub LTMovementSum1(y As Long, strStoreArea As String)
Dim recTmp As DAO.Recordset
Dim lngTotalLTagg As Long
lngTotalLTagg = 0
If Control.intLBoSNR = 1 Then
strQuery = "SELECT count(TIS_LAGERSPIEGEL.LT) FROM TIS_AGG_SNR " & _
"LEFT JOIN TIS_LAGERSPIEGEL ON TIS_AGG_SNR.SNR_KARTE=TIS_LAGERSPIEGEL.SNR_KARTE " & _
"WHERE TIS_AGG_SNR.LB= """ & strStoreArea & """;"
Set recTmp = db.OpenRecordset(strQuery)
If Not IsNull(recTmp.Fields(0)) Then lngTotalLTagg = recTmp.Fields(0)
ElseIf Control.intLBoSNR = 2 Then
strQuery = "SELECT count(TIS_LAGERSPIEGEL.LT) FROM SELECTED_SNR " & _
"LEFT JOIN TIS_LAGERSPIEGEL ON SELECTED_SNR.SNR_SPEICHER = TIS_LAGERSPIEGEL.SNR_SPEICHER;"
Set recTmp = db.OpenRecordset(strQuery)
If Not IsNull(recTmp.Fields(0)) Then lngTotalLTagg = recTmp.Fields(0)
End If
我不太了解我从recTmp = db.OpenRecordset(strQuery)
中得到什么以及recTmp.Fields(0)
中的内容>
我真的希望有人能帮助我,谢谢!
PS .: db是Access中的数据库
我是VBA的新手,我必须了解别人编写的代码。这是她为变量设置的内容:Sub LTMovementSum1(y as Long,strStoreArea As String)Dim recTmp As DAO.Recordset ...
没有那么多的想象力或幻想,您就会遇到很多坎bump。