G
Guest
We had a person set up the code below that under the GET CLIENT CODE is
getting the first 5 digits from a 10 digit UPC, or the first 6 digits from an
11 digit UPC from tbl1(CliCode). It then looks for a match in tbl3 to get
the CLIENT CODE from this table. It then adds this to tbl4 along with the
other information from tbl1. We've recently noticed that if the 5 or 6
digits code(CliCode) doesn't have a match in tbl3(CLIENT CODE), it is still
giving it a different CLIENT CODE from tbl3 that does not match the 5 or 6
digit code. I know very little about coding. From what I've pasted below,
can you tell why it would be giving a CLIENT CODE to a CliCode that does not
have a match?
'********GET CLIENT CODE********
If Len(tbl1!UPCCase) = 10 Then
temp = Mid(tbl1!UPCCase, 1, 5)
tbl3.FindFirst "[MAN_UPC] = " & temp & ""
If Not tbl3.NoMatch Then
CliCode = Nz(tbl3![CLIENT CODE])
End If
ElseIf Len(tbl1!UPCCase) = 11 Then
temp = Mid(tbl1!UPCCase, 1, 6)
tbl3.FindFirst "[MAN_UPC] = " & temp & ""
If Not tbl3.NoMatch Then
CliCode = Nz(tbl3![CLIENT CODE])
End If
End If
'********ADD INFORMATION TO TABLE*********
If doubles = True Then
For i = 0 To 1
cntr = cntr + 1
If i = 0 Then
WrhsCode = "SUPRBW"
Else
WrhsCode = "SUPHRM"
End If
tbl4.AddNew
tbl4!ID = cntr
tbl4!ClientCode = CliCode
tbl4!UPCCase = tbl1!UPCCase
tbl4!SVSize = tbl1!SVSize
tbl4!SVDescription = tbl1!SVDescription
tbl4!SVItemCd = tbl1!SVItemCd
tbl4!SVSell = tbl1!SVSell
getting the first 5 digits from a 10 digit UPC, or the first 6 digits from an
11 digit UPC from tbl1(CliCode). It then looks for a match in tbl3 to get
the CLIENT CODE from this table. It then adds this to tbl4 along with the
other information from tbl1. We've recently noticed that if the 5 or 6
digits code(CliCode) doesn't have a match in tbl3(CLIENT CODE), it is still
giving it a different CLIENT CODE from tbl3 that does not match the 5 or 6
digit code. I know very little about coding. From what I've pasted below,
can you tell why it would be giving a CLIENT CODE to a CliCode that does not
have a match?
'********GET CLIENT CODE********
If Len(tbl1!UPCCase) = 10 Then
temp = Mid(tbl1!UPCCase, 1, 5)
tbl3.FindFirst "[MAN_UPC] = " & temp & ""
If Not tbl3.NoMatch Then
CliCode = Nz(tbl3![CLIENT CODE])
End If
ElseIf Len(tbl1!UPCCase) = 11 Then
temp = Mid(tbl1!UPCCase, 1, 6)
tbl3.FindFirst "[MAN_UPC] = " & temp & ""
If Not tbl3.NoMatch Then
CliCode = Nz(tbl3![CLIENT CODE])
End If
End If
'********ADD INFORMATION TO TABLE*********
If doubles = True Then
For i = 0 To 1
cntr = cntr + 1
If i = 0 Then
WrhsCode = "SUPRBW"
Else
WrhsCode = "SUPHRM"
End If
tbl4.AddNew
tbl4!ID = cntr
tbl4!ClientCode = CliCode
tbl4!UPCCase = tbl1!UPCCase
tbl4!SVSize = tbl1!SVSize
tbl4!SVDescription = tbl1!SVDescription
tbl4!SVItemCd = tbl1!SVItemCd
tbl4!SVSell = tbl1!SVSell