Jump to content
Sign in to follow this  
ChangeAgent

Copying 8 fields at the same time with one button

Recommended Posts

FMP V6.04

I like to create a button that by clicking it would copy 8 fields (all address details of a client) so I can paste it in to another document.

I am not sure how to go about this.

Do I need to write a script, and if so does anybody have a sample as I am not sure how to go about it.

Alternatively I can think of creating a layout like an envelope and copy it from there. However I am not sure how to do this either as I can not find a way of copying this text field. In other words I would like a user to only have to click one button to perform the whole copy routine.

Maybe it is not possible? does anybody know?

Thanks for your help

Share this post


Link to post
Share on other sites

Hello ChangeAgent.

If the eight fields in question are the only fields on the current layout, then simply choosing Edit>Copy with no fields active (ie after exiting the record) will copy all eight at once.

However if that's not suitable, you will require a script and a global text field (which will have to be present on the layout, though it can be hidden).

The script (for FileMaker 6) can be structured as follows:

Set Field [GlobalTextField, Field1 & ¶ & Field2 & ¶ & Field3 & ¶ & Field4 & ¶ & Field5 & ¶ & Field6 & ¶ & Field7 & ¶ & Field8]

Copy [select All; GlobalTextField]

Exit Record/Request[ ]

Once you have created a three-line script along the lines of the above, you'll be able to attach it to a button if you wish. :wink2:

Share this post


Link to post
Share on other sites

Thanks CobaltSky,

No there are more fields on the layout otherwise I would have used the copy method.

I am going to experiment with your script. will report back. Pity the field (hidden) needs to be on the layout and can not be on some other layout as I have a compiled field (the 8 fields in one field compiled for a envelope printing job). No workaround?

thanks

Share this post


Link to post
Share on other sites

I have a compiled field (the 8 fields in one field compiled for a envelope printing job)

Sure - if you have such a field already available on another layout you can use it.

An alternative script to achieve that would be along the following lines:

Freeze Window

Go to Layout [YourOtherLayout}

Copy [select All, Your8ValueField]

Go to Layout [original layout]

:wink2:

Share this post


Link to post
Share on other sites

Now this is for fm6, but it isn't the healthiest of habits to teach newbes to reach out for clipboard tampering tools, when ever chances occure!

--sd

Share this post


Link to post
Share on other sites

Now this is for fm6, but it isn't the healthiest of habits to teach newbes to reach out for clipboard tampering tools, when ever chances occure!

--sd

Søren,

Kindly read the question.

ChangeAgent specifically asked for a way to copy some data to the clipboard for pasting into another document. FYI, the copy and cut commands are widely considered *industry best practice* for getting data onto the clipboard. :wink2:

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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