Thank you for your post.
Yes, you can make a field tool tip the same as the field's comment. Perform the following steps:
1. Pull down the View menu and select "Layout Mode".
2. Click on the field you want to display the field's comment.
3. Pull down the Format menu and select "Set Tooltip..."
4. In the "Set Tooltip" dialog box, click on the button "Specify". For the formula criteria, enter:
FieldComment (<name of database file in quotes>; <name of field in quotes>)
For example, if your database file is named "Contacts" and you are setting a Tooltip for the Last Name field, the formula would be:
FieldComment ("Contacts"; "Last Name")
5. Repeat steps 2-4 for all fields.
If you need clarification for any of the above steps, please let me know.
Thank you, works great. I was wondering if there is a more generic way to refer to the database and field names variables so that one argument would work for all tool tips?
The FieldComment() function requires two variables; the table, and the field name. I'm not sure how more generic you would want it... If you had a portal into another table, you would need to reference that table and field.
Maybe the better question is, "What would you like to see?" That might give me a better idea what you mean by "generic".
Well what I'd like to do is have one Tool Tip that would work for any field. That way I could just paste it in any field and it would work.
Thanks for the clarification. As an option for a singular tooltip, you can try this calc:
FieldComment (<name of database file in quotes> ; Get (ActiveFieldName))
Please note, however, the limitation with this calc is that a user will have to click in the field (triggering the Get (ActiveFieldName)) for the Tooltip to appear; hovering over a non-active field will not display the tooltip.
I can see how this may be a bit cumbersome but I wanted to let you know what your options were. Aside from this, following tsgal's post may be the best option.
Thanks for posting!
To avoid hard-coding the file name (which will break if you change the name of the file for any reason), you could use:
FieldComment (Get(FileName) ; Get (ActiveFieldName))
The limitation noted by tsturtle still applies with the use of Get (ActiveFieldName). It also has a more severe downside - if you look at the tooltip for any field that is not active, the tooltip will be that for the active field. For me, this is a show stopper.
So the most generic expression I can suggest is:
FieldComment (Get(FileName) ; "yourfieldname" )
And even this will break if you set tooltips for fields outside the current file. ;)
I'm using the calculation below right now. I use the semicolon to limit how much, if any, of the comment to display:Let([fieldName = GetFieldName ( Self );comment = FieldComment ( Get(FileName) ; fieldName );semicolon = Position(comment; ";";1;1)];fieldName &If( semicolon; "¶" & Left (comment ; semicolon-1 ); "" ))