if..then...end if

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

have a form with fields CustID and AreaCode
ie:
CustID AreaCode
1BH0001 2
1BH0002 2

2BH0001 3

what I like to do is with the if..then etc is:

If CustID = 1BH (then any 3 numbers) then
AreaCode = 2
Else If CustID = 2BH (any 3 numbers) then
AreaCode =3

etc etc
End If

Is there any symbol I can use, so it doesn't matter which 3 numbers I use,
aslong as the first number and subsequent 2 numbers are the same, that the
corresponding AreaCode is automatically filled in?
 
Try using the Like in the IF

If CustID Like "1BH*" then
AreaCode = 2
Else
If CustID Like "2BH*" then
AreaCode =3
end if
End If
etc etc
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top