crazybake Posted March 5, 2003 Posted March 5, 2003 I have a date field which is a dropdown menu with dates for a month. Is there a way to change this field per record? I want to be able to add text "Date not selected" to the date field when a date has not been selected and "job done" when a button is selected to change this inof. I thought about having a transparent field over the top which would clear the date field and set text to a text filed over the top. This would work, but I cannot figure out how to clear the text field when a user actually selects a date from the popup menu... any thoughts?
LaRetta Posted March 5, 2003 Posted March 5, 2003 Hi Crazybake Sorry, but no. You can add text to a number field, but not a date field. But you've almost got it with placing a field over another field! Create a new calculation field, possibly named cDateStatus, unstored (text) with the following formulae: Case(IsEmpty(YourDateFieldName),
Vaughan Posted March 5, 2003 Posted March 5, 2003 The way you work out which button is pressed is with the Status(CurrentMessageChoice) function. The buttons are refered to as 1, 2 or 3 (1 is the default button). It'd look something like this: If [YourDateField = "Job Done" ] Show Message [ "What would you like to do?"; "Delete Date", "Exit", "Change Date" ] If [status(CurrentMessageChoice) = 1] Set Field [ YourDateFieldName, whatever for delete ] Else If [status(CurrentMessageChoice) = 2] Set Field [ YourDateFieldName, whatever for exit ] Else Set Field [ YourDateFieldName, whatever for change ] End If End If I've changed it inot a Show Message step rather than Custom Dialog because you don't need text imput from the user, just a choice. It'd be exactly the same with custom dialog. Don't let the nested IFs fool you: work your way through the logic and you'll see it's not difficult.
LaRetta Posted March 5, 2003 Posted March 5, 2003 Thank you Vaughan! IF - IF - ELSE! So the script would be: If [ cDateStatus = "Job Done" ] Show Message [ Buttons: "Delete Date", "Change Date", "Exit Field"; Data: "This job is done. What would you like to do?" ] If [ Status( CurrentMessageChoice) - 1 ] Set Field [ YourDateFieldName, TextToDate("") ] Exit Record/Request End If If [ Status( CurrentMessageChoice) -1 ] Go to Field [ YourDateFieldName ] End If Exit Record/Request End If Else Go to Field [YourDateFieldName ] End If LaRetta
LaRetta Posted March 6, 2003 Posted March 6, 2003 Hi! I tweaked the above script and it works. If the date field has a date, it no longer displays but shows "Job Done" in red. If the User tries to enter the date pop-up, a message prompts them to confirm whether to delete the date, change the date or exit the field. I've found this exercise very helpful in controlling field displays and User modifications by overlaying a field with a scripted calculation. There is one *little* problem, however!! When the script enters the pop-up list field for the User to select (or change) a date, the list stays open!!! YIKES! Is there a way to correct this? LaRetta
Ugo DI LUCA Posted March 6, 2003 Posted March 6, 2003 Format this field to not allow entry then define the whole script as a button "go to date field". This would do the trick. Another problem will occur. You cannot use this layout for finds... Edited after reading Vaughan answer. Sorry for misunderstanding..
Vaughan Posted March 6, 2003 Posted March 6, 2003 Put another field underneath but without the pop-up list, and set the tab order so it's next in line.
LaRetta Posted March 6, 2003 Posted March 6, 2003 Hi Vaughan! Okay, I stacked in this order - bottom DateField (allow entry) tab order 3, DateField pop-up list (allow entry) tab order 2 and cDateStatus calc tab order 1. When I select the date field when Job Done, it works great! But, if I select the date field while "Date Not Selected", it dumps me into the standard date field. I have a demo file all set up ... I really want to figure this puppy out! I don't see a script selection to Go To Tab "2" of that date field -- darn! And why does the Message Box come up with the buttons in 'Reverse order"? LaRetta
LaRetta Posted March 6, 2003 Posted March 6, 2003 Hi Vaughan and Ugo! Thanks for the ideas! Well I corrected the bottom date field to not allow entry (tab 3), but the cursor still enters the field. I even spread the fields apart to see which field it's entering, and it enters the bottom *unenterable* date field. I think Go To Field bypasses Field Format options And with Job Done, NOW when I enter the pop-up list, it opens but stays open. Bummer! Well, I guess I'll play with this one on my own. It's too bad I couldn't tell the script to go to Tab 2 or go to the Date pop-up list somehow. LaRetta
Ugo DI LUCA Posted March 6, 2003 Posted March 6, 2003 Hi La Retta, Yu got me confused. What is exacly the problem. And where is the job done in red displayed ?
LaRetta Posted March 6, 2003 Posted March 6, 2003 Hi Ugo, If you check the entire thread you'll see what I'm trying to accomplish. The red calc will overlay the date pop-up list. I'm attaching my test file if anyone would like to help me. It just may not be possible (oh, I hate that phrase). Selecting pop-up menu works a bit better, but maybe scripts affecting pop-up lists just won't work (allow the pop-up list to close). Try 1 layout shows what originally worked for me, but if the calculation displayed "Date Not Selected", the pop-up wouldn't close after selecting a date. Try 2 layout shows the three fields (as per Vaughan's suggestion), but they are spread apart to watch what happens (or doesn't happen). Any help would be much appreciated as this is driving me nuts not to resolve it. LaRetta test Copy.zip
LaRetta Posted March 6, 2003 Posted March 6, 2003 Hi Ugo, Thanks! So the date field should not have "Allow entry into field." I've modified the original script to reflect this change. LaRetta
CobaltSky Posted March 6, 2003 Posted March 6, 2003 I suspect that what crazybake is looking for may be a little more like the attached? JobDate.zip
Lee Smith Posted March 6, 2003 Posted March 6, 2003 Very nice, smooth, only one little tiny question. How do you go back once you click done? Lee
Lee Smith Posted March 6, 2003 Posted March 6, 2003 Hi Ray, Well I'll be, it sure does. I liked it before, now I really like it. Thanks for showing me a very neat way of flagging a date. Lee
Newbies ehremann Posted March 6, 2003 Newbies Posted March 6, 2003 This is really top solver file. Never have I seen such a one. Great going!
Rangoon Posted March 6, 2003 Posted March 6, 2003 Stop with all these accolades, these guys are insufferable the way it is! But it is very cool isn
Ugo DI LUCA Posted March 6, 2003 Posted March 6, 2003 Accolade continues..... I already put that one in my file HI Vaughan, What about Ray's Babies ? lol Is there a "clonage" experimentation or something that I should be aware of, taking place in Australia. lol Is there a Wait List.
Rangoon Posted March 7, 2003 Posted March 7, 2003 Vaughn, I think you have the forums confused but not to worry. If you have a positive attitude it may not solve all the problems but it will annoy enough people to make it worth the effort... What about going halfs with me on one of Ray's kids? You know, that ol "Apple not far from the tree thing"!
crazybake Posted March 7, 2003 Author Posted March 7, 2003 Yep! That is exactly what I was looking for... Thanks for all of the input. I learned quite a bit about various options...
BobWeaver Posted March 8, 2003 Posted March 8, 2003 I want to have Ray's babies. Umm, Vaughan and Ray, I think the proper place to continue this line of discussion is in the "Relationships" forum. But do keep us posted with any developments.
Rangoon Posted March 8, 2003 Posted March 8, 2003 Bob, You are right of course. Relationships is the correct place. But I still want to go half on the kids! Vaughan hasn't responded as yet, I'm sure he just needs more time to think. I'm sure Ray is thinking, "what has happened to this thread" and I only remind him that Filemaker Pro is in fact "Relational". hj
Recommended Posts
This topic is 7935 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