susnhine92122 Posted February 4, 2008 Posted February 4, 2008 I'm sure there is a very simple way to execute this bt I am just having a brain fart. I have a database that keeps customer records including credit cards. When I type in a CC number I would like to have a field automatically tell me what type of CC it is, for example if the number starts with 6 it is discover etc. etc. Can anyone help? As of right now I have some very convaluted calculation that works intermittently and is not really 100% accurate -) Thanks
David Jondreau Posted February 4, 2008 Posted February 4, 2008 What cards do you accept? For Visa, MC, Amex, and Discover... Let([ init1 = Left(CC;1); init2 = Left(CC;2); init4 = Left(CC;4)]; Case( init2 = "34" or init2 = "37"; "American Express" ; init4 = "65" or init4 = "6011"; "Discover Card"; init2 = "51" or init2 = "52" or init2 = "53" or init2 = "54" or init2 = "55"; "MasterCard"; init1 = "5" ; "Visa"; "Error") )
susnhine92122 Posted February 5, 2008 Author Posted February 5, 2008 Thank you. I tried it, but am having some difficulties, first of all I'm self taught and I'm not well versed on the functions so I'm having a hard time troubleshooting. I understand the LET command, I replaced CC with my CC number field name, but I don't understand "init" if you have time, I could really use a little help in getting this to work.
susnhine92122 Posted February 5, 2008 Author Posted February 5, 2008 OK, I'm an idiot, I managed to figure it out I just needed to pay attention - thanks for your help, it works perfectly :blond:
Recommended Posts
This topic is 6197 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now