Field comment to Tool Tip
Hi, do you know of a straight forward way to make a field tool tip on a layout the same as the field's comment? Thanks.
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.
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. ;)
fieldName = GetFieldName ( Self );
comment = FieldComment ( Get(FileName) ; fieldName );
semicolon = Position(comment; ";";1;1)
If( semicolon; "¶" & Left (comment ; semicolon-1 ); "" )
Retrieving data ...