ECEstudent
Registered User.
- Local time
- Today, 13:29
- Joined
- Jun 12, 2013
- Messages
- 153
Hi, I hope someone can help me with this. I'm still researching for help but thought I'd post it here. whichever one helps me get the answer the fastest I guess. Anyways, I'd appreciate any help. Thanks in advance.
I realize the second if statement is incorrect since my code isn't compeletly doing what it's supposed to be doing. What is supposed to be happenening is that after I put values in an array, it's supposed to loop through each value to check if it exists in table 'tbl_LBP Sales Location Num' And if it does, also check that the column 'Rep Region Code' within that same table for that associated value , is not 'INT' nor 'inte'
I realize the second if statement is incorrect since my code isn't compeletly doing what it's supposed to be doing. What is supposed to be happenening is that after I put values in an array, it's supposed to loop through each value to check if it exists in table 'tbl_LBP Sales Location Num' And if it does, also check that the column 'Rep Region Code' within that same table for that associated value , is not 'INT' nor 'inte'
Code:
Set rstt = CurrentDb.OpenRecordset( _
"Select LEFT (RepId, 3) As RepIdd from CalculateTotal where ([Structure] like '*" & u & "*') Group By OrderNumber, Item, RepId", dbOpenDynaset, dbSeeChanges)
While rstt.EOF = False
ReDim Preserve Arry(n)
Arry(n) = rstt.Fields("RepIdd")
n = n + 1
rstt.MoveNext
Wend
y = Arry
VldOrdrNbrDestination = 0
OrderWOEditing = 0
For Each varCod In y
OrderWOEditing = OrderWOEditing + 1
If DCount("[Location ID]", "[tbl_LBP_Sales Location Num]", "[Location ID] LIKE '*" & varCod & "*'") > 0 Then
If Not "[Rep Region Code]" = "INT" And Not "[Rep Region Code]" = "inte" Then
VldOrdrNbrDestination = VldOrdrNbrDestination + 1
' MsgBox varCod
End If
End If
Next varCod