February 20, 200817 yr Essentially, I have one field that has more than one "passcode". If 1=1, 1. If 1=2, 2. If Neither, Show Message: "Incorrect Password" So far this is what I have, but it doesn't work as desired. ---- If 1=1, "Approved" Else Show Message: "Incorrect Password" End If If 1=2, "Approved" Else Show Message: "Incorrect Password" End If ---- Any tips would be greatly appreciated. Thank you kindly.
February 20, 200817 yr Could you provide a better explanation? AFAIK, 1=1 is always true, and 1=2 is always false, so I don't quite see the point in checking.
February 20, 200817 yr I think the OP is saying 1 is the field name. If[Passcode = 1] Show Custom Dialog["Approved"] Else If[Passcode = 2] Show Custom Dialog["Approved"] Else Show Custom Dialog["Incorrect Passcode"] End If Of course you could make the If statement If[Passcode = 1 or Passcode = 2] but the way I wrote gives you flexibility if you need to show different Approval messages for different passcodes. Note to OP: Don't name your fields after numbers, even in examples.
February 21, 200817 yr Author D J, I am currently using FileMaker 6 since we have some older systems around that don't support FM9. Hence There is no "Else If" command. Your 1st example is exactly what I am looking for, the 2nd example does not work because I am pulling in different signature fields based on the Passcode entered. Are there any other work arounds that don't use the "Else If" command? Thanks for the feedback, I will be sure not to use numbers as field names in my examples. Thanks again.
February 21, 200817 yr In version 6 you would use nested If blocks to achieve the same: If [ Test 1 ] # Result 1 Else If [ Test 2 ] # Result 2 Else # Default Result End If End If
February 21, 200817 yr Author D J and comment, thanks for your help, my Script now runs flawlessly. I didn't realize you can use nested If blocks, this will help out for some of my other Scripts as well. Thank you kindly. Edited February 21, 200817 yr by Guest
Create an account or sign in to comment