Multiple numbers on IF Statement

  • Thread starter Thread starter Bob Quintal
  • Start date Start date
B

Bob Quintal

=?Utf-8?B?U3RvY2t3ZWxsNDM=?=
Hello,

I am trying to get a field to prefill after update if
statemeent is correct. What I am trying to do is this:

If CollCode = 130, 131,132,133,134,135,335,336,400 Then
Rate = 0.0833
End If

This doesn't work the numbers after CollCode are in red. Does
anyone know a way to make this work maybe without typing in
all the numbers? I know I can do an IF Statement for each
CollCode but I have about 20 so I was trying to take a
shortcut.

Thanks!!!
Dim CollCodes as string
CollCodes = " 130, 131, 132, 133, 134, 135, 335, 336, 400,"
if instr(1, Collcodes, " " & str(CollCode) & ",") > 0 then
rate = 0.0833
end if
 
Hello,

I am trying to get a field to prefill after update if statemeent is correct.
What I am trying to do is this:

If CollCode = 130, 131,132,133,134,135,335,336,400 Then
Rate = 0.0833
End If

This doesn't work the numbers after CollCode are in red. Does anyone know a
way to make this work maybe without typing in all the numbers? I know I can
do an IF Statement for each CollCode but I have about 20 so I was trying to
take a shortcut.

Thanks!!!
 
Back
Top