Scott Loeb Posted July 6, 2003 Posted July 6, 2003 Ok I'm terrible at explaining my question, here's what I want to do? I have a button that says complete. When the user clicks complete I want the word complete to dissapear and the current date to show up. I could easily do an if statement. But, I need to do a date calculation, so if its a text field the date calc won't work, and if its a date field, the word "complete" won't show. So my question is: can I have a button in front that says "complete", and a field behind. When complete is clicked, the field with the current date covers the complete button permanently? Thanks
CobaltSky Posted July 6, 2003 Posted July 6, 2003 Hello Scott, There are various ways to achieve the effect you're after, but perhaps not quite in the way you are envisaging/describing it. However I would suggest that you reconsider using a text field for this. What I'd recommend is that you create a text field and set it up to auto-enter the word 'complete' when the record is created. Then attach a script to it with the single step: Set Field ["YourField", "DateToText(Status(CurrentDate))"] Finally, whenever you want to reference the date in calculations elsewhere in your solution, use an expression along the lines of: Case(not YourField = "complete", Date(LeftWords(YourField, 1), MiddleWords(YourField, 2, 1), RightWords(YourField, 1)) The above calc expresion will convert the date (assuming it's in dd/mm/yyyy format) into FileMaker date format for use in your calculations. As I said, there are several other ways to get the kind of effect you're going for, but the above is relatively clean and should not be too hard to set up and test...
Scott Loeb Posted July 6, 2003 Author Posted July 6, 2003 Are there any other ways. My thing is, A due date is manually entered, and when the task is completed, the complete button is clicked. The I have a relationship in another file for only the head person to see the due date and the completed date. The date calculation is: if (due date < complete date) then another field says "Late", or else says "on time". Probably real simple, but I don't understand the {Case(not YourField = "complete", Date(LeftWords(YourField, 1), MiddleWords(YourField, 2, 1), RightWords(YourField, 1)) ] I'm not that advanced yet. I hope that makes more sense, Scott
CobaltSky Posted July 6, 2003 Posted July 6, 2003 Hi Scott, Well yes, there are other ways, but most of them are more advanced than the one I suggested above, rather than less. However assuming that your calculation is exactly as you've cited in your post, then you could use the formula: Case(complete date = "complete", "", due date < Date(LeftWords(complete date, 1), MiddleWords(complete date, 2, 1), RightWords(complete date, 1)), "Late", "On Time") you should be able to just copy and paste it from this forum post, straight into your calculation window, and it should work. Alternatively, you could create a calculation field with result type set to 'date' and with the formula: Date(LeftWords(complete date, 1), MiddleWords(complete date, 2, 1), RightWords(complete date, 1)) and that will interpret the text date from the field that users click on. Failing that, you might prefer to handle the process the other way around, and have your script targeting a date field rather than a text field. The you could set up a calculation field (result type text)that is what the users see, with the formula set along the lines of: Case(IsEmpty(complete date), "complete", "DateToText(complete date)) ...then set the calc field up as the button that users will click on. Hope that gives you enough ideas to choose from, and that you'll find something that works for you.
Scott Loeb Posted July 6, 2003 Author Posted July 6, 2003 Thank you very much for taking the time Ray, the last one worked fine Scott
Recommended Posts
This topic is 7881 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