Why not Replace Field Contents in Research_A with a calculation: Research_A &"[return character]" & Research_B, then remove the field Research_B?
Can't be undone, try on a back up, usual warnings...
Thanks. Works so far when its part of the import script, of course it applies to all records. I will see how it goes.
Is there any way you can eliminate the "return character" if Research_A as empty for particular records? Otherwise the "return character' will be inserted into all the fields, even the empty ones.... Obviously the replace will have to be done one record at a time..?
Replace the 'Replace...' calculation with
Research_A = "" ; "" ;
Research_A & "<return> "
"Obviously the replace will have to be done one record at a time..?" No - the 'Replace Field Contents...' function replaces the data in the selected field in ALL RECORDS IN THE FOUND SET. IT CANNOT BE UNDONE. So go easy...
Thanks, I have the "Case" function working and the text formatted properly in a new calculated field that I have created "Research_Combined" to test it all.
Case ( Research_A = "" ; Research_B ;
Research_A & "¶¶" & Research_B)
Obviously being a calculated field I can not edit the new field. My issue now is what is the best way to have the "Research_Combined" values transferred into the "Research_B" field that can be edited. Keeping in mind I only want to keep Research_B field in the new database, and only wish to have the text from Research_A insert before it if there is data present.
I am not sure if I am tackling this problem the correct way. I am also not totally up with importing and creating loops....
"I am not sure if I am tackling this problem the correct way" - Bad news: you're not. Good news: it's even easier than you've made it.
Previous comment: "Replace Field Contents in Research_A with a calculation: Research_A &"¶" & Research_B, then remove the field Research_B"
You didn't need to create any calculation field, and your previous text-finding scripts etc would still work. They only need to work on Research_A field, because it now has all the data. You can edit it how you wish.
There's nothing to stop you doing this as part of the import, but I assume you will only do it once, so I wouldn't have bothered doing anything fancy.
In your original file with two fields, find all records, click into Research_A, select Records -> Replace Field Contents, choose 'By calculation...', set the calculation to be the case statement, and go for it.
***The 'Replace Field Contents...' function replaces the data in the selected field in ALL RECORDS IN THE FOUND SET. IT CANNOT BE UNDONE. So go easy...**** (Do it on a copy of the file first.)
I think I will play around with the import script as see what happens....
Why are you bothering...?
In fact what are you importing? I thought you had an FM11 file which now needed less features than before because of the FM11 upgrade. I didn't realize that you had some new file from which you are trying to import data from an old file.
I am basically a noob at this. I have about 16 different fields I would like to combine into one editable text field. There is also additional text that has to go inbetween some of the field information also. What is the easiest way to do this, also all of the info is within one record right now.
Are you importing anything from one file to another, or are you modifying data in one file?
Although you don't need to, for safety's sake I'd create a 17th text field - call it ResearchNotesAll.
Let's say between the notes Research_B and Research_C you want to insert the text "--- Below are special notes ----".
- Find all records (or at least all that you want to do this for. In your case that is only one record, this time, but it seems to me there's something missing in the design concept if you only need one record - unless you are just starting out and testing it?)
- Click into the field ResearchNotesAll
- Select from the Records Menu the option 'Replace field contents...'
- In the dialogue box select 'Calculation...'
- Insert the Case Statement calculation:
Case ( Research_A = "" ; "" ; Research_A & "¶¶" )
Case ( Research_B = "" ; "" ; Research_B & "¶¶" )
& "--- Below are special notes ----¶¶" &
Case ( Research_C = "" ; "" ; Research_C & "¶¶" )
blah, blah..., 16 times.
- Select OK, etc and 'Replace' the contents. It should have combined all 16 fields together and inserted the text between them. By the way, FM has a limit how much text it can take in one text field, but it is pretty huge.
I am wanting to modify the data from one file/record. This function will be common in all of the records, but the information changes, so I need to make it generic and editable. I haven't used the Case function at all and am not sure what that does in this instance.
In a nutshell there are actually 9 text calculations that I want to bring into one big field and edit that then needs to be copied and pasted into email. Also, I should note I am using FM7.
Sorry - Ive got myself confused now. I've just spotted that the poster changed from Mitch to Peter Knipschied. You said that you had 16 fields, then 9, then one record, then you want it to apply to all records... my head's in a spin.
If you want to bring the contents of 9 text fields into 1 'big' text field, then the suggestion I made above will work. Just change the field names to be yours.
It will perform that 'copy-join-paste into the Big Field' across every record in your found set. The first record's Big Field will have the result of its concatonated 9 fields on it, the second record will have the result of its 9 fields, etc.
The Case function just checks to see if the first field contains any data. If it does, it includes it in the Big Field and adds a couple of returns. Then it checks if there is anything in the second field, and if so it adds it on to the end of the first data. BUT that was the requirement of poster Mitch - I don't know if that is your requirement.
You won't need to copy and paste it into an e-mail - FM can do that for you.
I believe all the functions etc I described work in FM7.
Is the "replace" you mention a automatic action, or is it something that can be scripted to perform so the end user doesn't have an extra step.
Like I said I am still green. It's been a long while since I have had any training and I am real rusty at this so I might as well be a noob.
I just read through your notes and I got the function to work with the button and the extra field. SWEET! Thanks.
I think I may have led you up the garden path i my poor explanation. I have a database being used by a number of friends made on FMP11, it has Research_A and Research_B fields, both limited to one page of text, because of the multiple page print bug in FMP 11 v2.
Now there is a fix in this in FMP 11 v3 update.
I now need to create a new version of my database so they can use it, and obviously import all their old records. My new database has the import function working so far as it is the second version I have created for them, this will be the third.
In the new version of my database I wish to keep Research_B and now make it capable of printing several pages of text, easily achieved already. I no longer need a Research_A and will remove it, however I need to place any data in Research_A into Reserach-B so as to not loose any data from the old version. It does not bother me if this is done through either import or any other method....
Research B on the new version obviously needs to remain an editable field.