Jump to content
Server Maintenance This Week. ×

Auto date input after printing


This topic is 6519 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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!

Link to comment
Share on other sites

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.:P

Print[]

SetField[YourDateField ; Get(CurrentDate)]

~Genx

Link to comment
Share on other sites

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....

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 6519 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.