dbTalk Databases Forums  

Insert TAB into calculated field

comp.databases.filemaker comp.databases.filemaker


Discuss Insert TAB into calculated field in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Don
 
Posts: n/a

Default Insert TAB into calculated field - 08-11-2003 , 12:49 AM






I'm trying to create a function with FM Pro 4.1 where a user can click a
button on a screen causing a group of five fields to be copied into the
clipboard, and then switch to Excel to paste the values into horizontally
consecutive cells. I've created a calculated field that contains the
concatenated text of the five fields, separated by the "paragraph" mark. I
also created a button with a script that puts the contents of this field
into the clipboard. When the user goes to Excel and selects a cell, the
five values copy to vertically adjacent cells, not horizontally, even though
I've set the Excel prefs to "move right" with the Return key.

So I'm thinking if I could separate the data with a TAB key instead of the
paragraph mark, that might do the trick. So far I can't figure out how to
do that. Can it be done?

By the way, my workaround in Excel is to create a macro that places the data
vertically off to the side of the spreadsheet, and then does a Copy - Paste
Special - Transpose to the desired cell. It works, but it does have some
undesireable side effects - like using cells way off to the side, which
causes the spreadsheet to scroll right when the macro is activated.

Another question: I have found that the Filemaker calculated field must be
visible on the layout or else the button doesn't work. Why would that be?
The script is very simple: just Copy(Select,Fieldname). If the field is on
the layout, it becomes the active field when the button is clicked. If it
is not on the layout, the clipboard does not get updated when the button is
clicked.



Reply With Quote
  #2  
Old   
Bridget Eley
 
Posts: n/a

Default Re: Insert TAB into calculated field - 08-11-2003 , 01:13 AM






in article 48GZa.119128$YN5.84210@sccrnsc01, Don at
reply.to.group (AT) saynotospam (DOT) com wrote on 11/8/03 3:49 PM:

Quote:
I'm trying to create a function with FM Pro 4.1 where a user can click a
button on a screen causing a group of five fields to be copied into the
clipboard, and then switch to Excel to paste the values into horizontally
consecutive cells. I've created a calculated field that contains the
concatenated text of the five fields, separated by the "paragraph" mark. I
also created a button with a script that puts the contents of this field
into the clipboard. When the user goes to Excel and selects a cell, the
five values copy to vertically adjacent cells, not horizontally, even though
I've set the Excel prefs to "move right" with the Return key.

So I'm thinking if I could separate the data with a TAB key instead of the
paragraph mark, that might do the trick. So far I can't figure out how to
do that. Can it be done?
Yep, tabs move between fields in a record and are equivalent to the columns
of a table whereas returns represent breaks between records and are
equivalent to the rows of a table
Quote:
By the way, my workaround in Excel is to create a macro that places the data
vertically off to the side of the spreadsheet, and then does a Copy - Paste
Special - Transpose to the desired cell. It works, but it does have some
undesireable side effects - like using cells way off to the side, which
causes the spreadsheet to scroll right when the macro is activated.

Another question: I have found that the Filemaker calculated field must be
visible on the layout or else the button doesn't work. Why would that be?
The script is very simple: just Copy(Select,Fieldname). If the field is on
the layout, it becomes the active field when the button is clicked. If it
is not on the layout, the clipboard does not get updated when the button is
clicked.
Script steps such as copy and paste require that a field be on a layout to
work - Set Field does not require this and is much more powerful and
versatile. The calc would look like:

Field 1 & "(tab)" & Field 2 & "(tab)" & Field 3 & "(tab)" & Field 4 &
"(tab)" Field 5 & "(tab)"

(where (tab) is a tab copied from a text editor)

Bridget Eley



Reply With Quote
  #3  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Insert TAB into calculated field - 08-11-2003 , 01:37 AM



In article <48GZa.119128$YN5.84210@sccrnsc01>, "Don"
<reply.to.group (AT) saynotospam (DOT) com> wrote:

Quote:
I'm trying to create a function with FM Pro 4.1 where a user can click a
button on a screen causing a group of five fields to be copied into the
clipboard, and then switch to Excel to paste the values into horizontally
consecutive cells. I've created a calculated field that contains the
concatenated text of the five fields, separated by the "paragraph" mark. I
also created a button with a script that puts the contents of this field
into the clipboard. When the user goes to Excel and selects a cell, the
five values copy to vertically adjacent cells, not horizontally, even though
I've set the Excel prefs to "move right" with the Return key.

So I'm thinking if I could separate the data with a TAB key instead of the
paragraph mark, that might do the trick. So far I can't figure out how to
do that. Can it be done?

By the way, my workaround in Excel is to create a macro that places the data
vertically off to the side of the spreadsheet, and then does a Copy - Paste
Special - Transpose to the desired cell. It works, but it does have some
undesireable side effects - like using cells way off to the side, which
causes the spreadsheet to scroll right when the macro is activated.
The easiest way is probably to create a global text field and
paste/type a single tab into that, then use that field in your
calculation whenever you need a tab.
eg. Field1 & gTab & field2 & gTab & Field 3

Note: to type a tab in FileMaker text fields you need to press Option
Tab on the Mac (for Windows it might be Control Tab) since pressing
just Tab will go to the next field in the tab order.



Quote:
Another question: I have found that the Filemaker calculated field must be
visible on the layout or else the button doesn't work. Why would that be?
The script is very simple: just Copy(Select,Fieldname). If the field is on
the layout, it becomes the active field when the button is clicked. If it
is not on the layout, the clipboard does not get updated when the button is
clicked.
To use the copy or paste script steps the fields need to be on the
layout - this is because the script steps basically do the same as you
would with the mouse (select text and copy, or insert cursor and
paste).

There's no real way around this for what you doing except perhaps
putting the field on a separate layout. You can then use the Freeze
Window script step before going to the layout to copy the fields
content, then go back to the original layout. This way the user doesn't
see the layout change and the copy process.

You can also put a Go To Field script step at the end of the script to
go to any other field, or simply use the Exit Record script step so
that the cursor isn't left in any field at all.



Helpful Harry
"Just trying to help whenever I can." )


Reply With Quote
  #4  
Old   
LaRetta
 
Posts: n/a

Default Re: Insert TAB into calculated field - 08-11-2003 , 02:30 AM




Hi,

You can also insert a tab directly into the calculation box by
(on Windows) [CTRL] [Tab]. Sorry, I'm not sure on Macs - maybe
Option - Tab?

LaRetta

--
Posted via http://dbforums.com

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.