April 4, 200520 yr Hi everyone, I am creating a stand alone solution that has serial numbers for access purposes. I have a global field (gSerial Pool) with all acceptable serial numbers in it. For now they are separated with a comma. I have another global field (gSerial Number) that is an entry field. the user enters a serial number and I have a third field, (gAccount Name) that will check if the number is in the list. the current calc looks like this: If( PatternCount (gSerial Pool ;gSerial Number); "Customer"; "Trial" ) I am using this so I can distribute the software for trial with limited access, if they register, they get a serial number which will open up all records. The problem I have is that the pattern count doesn't seem to work. If I have a serial number of "123456" then entering any number from 1 thru 6 works and I want it to work only if they enter all of them. Any suggestions?
April 4, 200520 yr Try: Case ( Position ( "," & gSerialPool & "," ; gSerialNumber ; 1 ; 1 ) ; "Customer" ; "Trial" )
April 5, 200520 yr No, of course not. Sorry, don't know what happened here - I pasted it from my test file, then somehow managed to mangle it when changing the field names to yours. Anyway, this should do the job: Case ( Position ( "," & gSerialPool & "," ; "," & gSerialNumber & "," ; 1 ; 1 ) ; "Customer" ; "Trial" )
April 5, 200520 yr Author Well That worked better, but only the first seial number in the gSerialPool worked, the rest didn't. In other words I filled gSerial with 12, 13, 14, and when I entered 1 in gSerialNumber it didn't authorize and when I entered 12 it did, which was great. But it didn't authorize 13 or 14.
April 5, 200520 yr Well, when you say comma separated - I am thinking comma separated. Not comma-and-space separated. OK, let's see: Let ( [ list = "," & TrimAll ( gSerialPool ; 0 ; 3 ) & "," ; this = "," & gSerialNumber & "," ] ; Case ( Position ( list ; this ; 1 ; 1 ) ; "Customer" ; "Trial" ) )
April 5, 200520 yr Author I think I got it. I eliminated the gSerialPool field and made a value list of serial numbers and changed the calculation to read: Case ( Position ( "
Create an account or sign in to comment