Hi Guy's, hope all is good with you all
I have had a quick search and can't find the correct syntax for using the In Function within a search criteria
A: Finding a result based on a single number is fine ie: 7
B: Finding a result between 2 numbers is fine ie: 1 to 15
C: Now need to find the result based on a break of numbers trying to use the In function ie: 10,11,13,14 (12 not included)
A: Single Number OK
Code:
intID = Me.ID
Select Case intID
Case Is = 22
blNew = True
iSort = 10
iQty = DSum("StartQty", "tblStock", "[NewType] = " & blNew & " And [SortNo] = " & iSort)
Debug.Print "ID: " & intID & vbCrLf & "Qty: " & iQty
B: Between Numbers
Code:
Case Is = 28
blNew = True
iSortStart = 1
iSortEnd = 15
iQty = DSum("StartQty", "tblStock", "[NewType] = " & blNew & " And [SortNo] Between " & iSortStart & " And " & iSortEnd)
Debug.Print "ID: " & intID & vbCrLf & "Qty: " & iQty
C: Use the In Function as there is a break in what to find (can't find syntax
Code:
Case Is = 23
blNew = True
iQty = DSum("StartQty", "tblStock", "[NewType] = " & blNew & " And [SortNo] In (11,12,14,15))
Debug.Print "ID: " & intID & vbCrLf & "Qty: " & iQty
As always thank you for help