September 22, 200718 yr I am trying to work out how I can insert week and year in a field. So I have a button and when I click it will insert "43 '07" or similar. Or if you have a better idea, as I work with week's in my database, and every year have the same week's I have to separate them for each year. Thanks, Mats
September 22, 200718 yr Why a button? When an autoenter (update) could do exactly this provided the entry field is "text"... you can even tie a popup calendar to a text field... Let (td=GetAsDate ( Self );WeekOfYear ( td ) & " '" & Right(Year ( td );2)) --sd
September 22, 200718 yr Author I tried to insert your formula in a text field, and it did not work (give any value)? I don't really understand what is autoenter but I think you mean that the value week and year will be inserted automatically when I work with the record. I prefer to have a button to insert the value because I don't wont a new week in some of the records I work with. Only if I have a result / agreement with the customer I will click the "week button" and insert current week and year.
September 22, 200718 yr Ah I didn't see you were on fm8 when I used a fm9'ish thing - Sorry. If you need the button to do so: Let (td=Get(CurrentDate);WeekOfYear ( td ) & " '" & Right(Year ( td );2)) I would prefere Set Field[ over Insert Calculated result in the buttons one-liner, in order to make it independent of the layout! --sd
September 22, 200718 yr Author Aouch, sorry. I just changed to FM9 so the first formula maybe would be right? But it did not work for me. As English is not my language, would you mind explain what you mean with your suggestion "Set Field"? And also a quick guide how to implement the two formulas. Thank you very much for your help!
September 22, 200718 yr No the first formula only works underneath a field, if scripted have Self as far as I have expirienced no workings. I've made you a template including both methods I gave, in the first line the yellow'ish are you shown a calendar when trying to enter stuff in it, while the second always fill in the present week number and year following the clock in the computer's setup. As English is not my language, would you mind explain what you mean As you probably have guessed isn't it mine either, if you need something a bit more scandinavian might I suggest you rush to this instead: http://www.filemakercenter.dk/Sektioner/Forum/forumForside.html --sd mats.zip
Create an account or sign in to comment