question

user-1280 (google) avatar image
user-1280 (google) asked

how do this function in sql function

Public Function GetItemQunt11(ByVal ItmCode As String, ByVal StkCode As Double, ByVal Qunt As Double) As Boolean Dim TTab As Recordset Dim SqlStr As String

SqlStr = "SELECT SUM(Quntity) AS VL FROM ItemTran " SqlStr = SqlStr & " WHERE ItemCode = '" & ItmCode & "'" SqlStr = SqlStr & " AND StkCode = " & StkCode SqlStr = SqlStr & " GROUP BY ItemCode,StkCode" Set TTab = DB1.OpenRecordset(SqlStr, dbOpenDynaset) If Not TTab.EOF Then TTab.MoveFirst If TTab("VL") < Qunt Then MsgBox "aaa" GetItemQunt = False Else GetItemQunt = True End If Else MsgBox "bb" GetItemQunt = False End If End Function

user-defined-function
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.