Newbies JayE Posted March 2, 2003 Newbies Posted March 2, 2003 I'm having trouble with validating a field by a calculation. Here's the goal. I want a field to be "Not Empty" if another field is not empty and a certain condition exists based on a flag field. Here's my calculation: If(not IsEmpty(Mark) and Status="p",1,0) Mark and Status are text fields. I want another field, Com, to be Not Empty if this validation is true. I can't seem to get this to work. Am I doing something wrong?
LiveOak Posted March 2, 2003 Posted March 2, 2003 not IsEmpty(Com) and not IsEmpty(Mark) and Status="p" or IsEmpty(Com) and (IsEmpty(Mark) or Status <> "p") -bd
Newbies JayE Posted March 2, 2003 Author Newbies Posted March 2, 2003 Maybe a little more detail would help. Initially both Mark and Com are empty. If the user enters a value into Mark, and Status is "P" (set through a test when the file is opened) I want to force the user to enter a value into Com. If Status is not "P", a value is not required in Com and the user may proceed.
Lee Smith Posted March 2, 2003 Posted March 2, 2003 Isn't the second calculation the opposite of the first calculation. Shouldn't you have a Not in front of both IsEmpty(s)? I made a little test file and the fields have to have entry in the two fields in the first validation and can't have entry in the second validation. Lee
LiveOak Posted March 2, 2003 Posted March 2, 2003 Lee is correct, it should read: not IsEmpty(Com) and not IsEmpty(Mark) and Status="p" or IsEmpty(Mark) or Status <> "p" -bd
Newbies JayE Posted March 2, 2003 Author Newbies Posted March 2, 2003 Again, I am trying to validate Com. As such, I cannot refer to Com in the calculation. Or am I wrong about that? The 2nd recommendation is is essentially what I indicated I've tried in my initial post. I have tried: not IsEmpty(Mark)and Status="p" with the Not Empty checkbox selected. This does not work when Status is other than P. Any other suggestions?
Lee Smith Posted March 3, 2003 Posted March 3, 2003 You can when it's a validation of a field. Go to Define Fields, click on the "Com" and then click on the Options. You will see the menus Auto Enter - Validation - Storage. Click on Validation and paste in the calculation from bd in the Calculation Box. HTH Lee
Newbies JayE Posted March 3, 2003 Author Newbies Posted March 3, 2003 Ok, yes I can do that but the validation still does not work as I want it to. Status can have 2 states. P or R. The validation calculation as enter (or any way I have tried for that matter) still requires the user enter a value in Com, even when Status is "R"?:? Any ideas on what I am doing wrong? Is this because I have the Not Empty box checked? I want the user to have a choice as to whether they make an entry into Com when Status is "R". Seems like this shouldn't be so difficult.
Ugo DI LUCA Posted March 3, 2003 Posted March 3, 2003 Which calc are you using. I didn't tried it but it seems to be that if you use not IsEmpty(Com) and not IsEmpty(Mark) and Status="p", + check "not empty box", then you cannot have Com Empty anymore or you will be locked... Why not use the "R" instead of "P" in the calc you're looking for and what exactly are the records to be entered (or not) in Mark (1,0 ?)
Ugo DI LUCA Posted March 3, 2003 Posted March 3, 2003 Don't know if that can suit your needs. 1. Create a new field "D" set autoentered calc = Case(IsEmpty(Com),1,0) 2. use a new calc = D = 0 xor not IsEmpty(Mark) and Status = "R" This allows to leave Com Empty if Status = R but you cannot leave Com Empty if the value is not "R"
Newbies JayE Posted March 3, 2003 Author Newbies Posted March 3, 2003 Thanks for all your suggestions but none of them work. I'm taking the rest of the night off on this one! As I said earlier, it seems like this should be fairly easy to accomplish but..................
LaRetta Posted March 3, 2003 Posted March 3, 2003 Hi Jay Again, I am trying to validate Com Well, something to consider: I believe that a validation by calculation (on the Comm field), will only activate if the User has clicked into the Comm field and then tries to leave. An empty Comm field can't be validated (I don't think), if it hasn't been accessed yet. So if a User enters something in Mark but doesn't then go to Comm, it won't work. You might try putting Comm in tab order right after Mark but, Users can click their way out of that pretty easily, I believe You might try adding a validation by calculation to Method instead, along the lines of: Case(not IsEmpty(Mark) and Status = "P", 1) Then select Display a Message and *warn* Users to fill in Comm. You can't click "Strict Do Not Allow Override) because the User wouldn't be able to proceed to Comm to fill it in. Otherwise, if Comm MUST be filled in, I think you'll need to use another method, such as possibly a Script or Plug-In, to test the Status and whether Method has been filled in before a User is allowed to exit the layout. LaRetta
Recommended Posts
This topic is 8007 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