Beemouse Posted June 20, 2006 Posted June 20, 2006 Hi - I am new to FileMaker (Pro 7), though I've worked a bit with Access... I have created a report which is printed when a button I scripted is pressed. Under this button I have created a field which I would like to be automatically filled in with the date of impression of the report. How do I do this? I'm sorry if someone has already asked this question - I coudn't find an adequate response. Thanks!
IdealData Posted June 20, 2006 Posted June 20, 2006 Use the SetField() script function... SetField(Report_Date, Get(CurrentDate))
Beemouse Posted June 20, 2006 Author Posted June 20, 2006 What category is that under? Unfortunately I'm in France, working with a French version of FilMaker....
Beemouse Posted June 21, 2006 Author Posted June 21, 2006 I'm sorry, but I still don't understand what to do
Genx2 Posted June 21, 2006 Posted June 21, 2006 Your script should look something like this: Allow User Abort[off] Set Error Capture [on] Go To Layout [Print Layout] Print[] If[Get(LastError) = 0] SetField[YourDateField ; Get(CurrentDate)] End If Go To Layout[original layout] Or a simpler version that doesn't check for when user cancel's etc. Print[] SetField[YourDateField ; Get(CurrentDate)] ~Genx
Beemouse Posted June 21, 2006 Author Posted June 21, 2006 Thank-you! In fact, my script just got more complicated. I have a field in ly DB which defines the type of contact (Assos, agency or company). Upon pressing the button, I want not only the field discussed above to be filled in withthe correct date, but I also want FM to print seperate letters depending on the contact type stipulated in the 'Contact type' field. I imagine this is possible? Thank again for any help! If my boss were not a bastard too cheap to hire an IT guy to create this BDD I wouldn't be hasssling you all. Alas....
Genx2 Posted June 21, 2006 Posted June 21, 2006 Lol, yes, its all possible, we just use the following: If[YourContactTypeFieldHere = "Assos"] Do This Stuff Else If[YourContactTypeFieldHere = "Agency"] Do This Other Stuff Else If[YourContactTypeFieldHere = "Company"] Do This other other stuff Else Show Custom Dialog["error" ; "You have not specified a valid contact type"] End If
Beemouse Posted June 21, 2006 Author Posted June 21, 2006 Great! Now I have to try and find the translations for all the scripts in French and away I go!
Genx2 Posted June 21, 2006 Posted June 21, 2006 Lol, i'm sure it shouldn't be to hard, its only four types in total and they'll be located around the same area. French though eh, i can't say i loved doing that in high school, but hey, anything beat trying to work out Japanese. ~Genx
Recommended Posts
This topic is 6732 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