Mats Posted September 22, 2007 Posted September 22, 2007 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
Søren Dyhr Posted September 22, 2007 Posted September 22, 2007 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
Mats Posted September 22, 2007 Author Posted September 22, 2007 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.
Søren Dyhr Posted September 22, 2007 Posted September 22, 2007 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
Mats Posted September 22, 2007 Author Posted September 22, 2007 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!
Søren Dyhr Posted September 22, 2007 Posted September 22, 2007 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
Mats Posted September 22, 2007 Author Posted September 22, 2007 Now it's working like I want. Thanks "Dane" ???
Recommended Posts
This topic is 6332 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