Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hi everyone. How can I get two fields contents to appear in just one field as well. By that I mean I have two fields Surname & 1st Name in that order. I would like the contecnts of those fields to appear in another Layout in just one Field called Full Name. How would I go about doing this please.

Do hope you great guys will help me again here.

Mark

Posted

You could make a calc field (that is not stored) and the calc would be :D

emp_name_last & "," & emp_name_first

Or look into Merge fields....<??>

Hope that helps

Posted

Hi Mark:

If you'll never need to perform a Find on the Full Name, the Merge Field suggested by agtjazz would work pretty well. In a text object on your layout, use the Merge Field command under the Insert menu to build an expression similar to ... <>, <> ... and that should just about do it.

There are some considerations to this approach, though. For one, it is not searchable. If you define a field as a stored calculation, you can perform a Find on the FullName field where it appears on any layout.

Another problem revolves around the leading or trailing "comma-space" characters when both fields are not populated. Under the Merge Fields technique, there's no way to address this problem ... short of creating a calculation field, which would be kinda circular, wouldn't it?

Under a text calculation field, you can avoid the same "comma-space" problem if the argument provides for all possible permutations. There are a number of techniques to achieve this, but the one below may help you gain a foothold as you go further with FileMaker:

Case ( 



	( not IsEmpty ( Surname ) ) and ( not IsEmpty ( FirstName ) ) ; Surname & ", " & FirstName ; 



	( not IsEmpty ( Surname ) ) and ( IsEmpty ( FirstName ) ) ; Surname ; 



	( IsEmpty ( Surname ) ) and ( not IsEmpty ( FirstName ) ) ; FirstName ; 



	( IsEmpty ( Surname ) ) and ( IsEmpty ( FirstName ) ) ; "" 



)

Make sure the calculation results in Text. Activating the "Do not evaluate if all referenced fields are empty" option obviates the need for the last Case permuation, but it won't hurt anything. Finally, set the calculation to "stored" if you'll ever want to search on its contents.

I hope you find this useful. Some folks don't mind trailing commas; others want their work to appear more thoughtful. I've occassionally walked out of the house with my fly inadvertently open, but I still try to avoid it.

Posted

You guys are great. I have played with the several suggestions above, but have come back to the commnad.

I have decided that the Full Name will not be an option for the search, which is no biggy. However, I am sure that as I progress and my Database becomes more sophisticated (and it will - it is 10 times more sophisticated than it was 3 weeks ago), I will look at the other possible implementations mentioned here.

So thanks again for the help! You guys are not only making it easier for me to build this database, but because of you I am learning! A Silver Surfer Learner!!!!

This topic is 6633 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.