vba 连续形式的动态工具提示

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13365215/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 18:29:21  来源:igfitidea点击:

Dynamic tooltip in continuous form

vbams-accessms-access-2010

提问by Marc

The problem is I have a continuous form and there's a column that the tooltip is not the same for every rows.

问题是我有一个连续的表单,并且有一列工具提示对于每一行都不相同。

For example:

例如:

The users are used to refer regions as a number, so I would display to number and I would display the complete name in the tooltip. That way I save space and there's no scrollbar.

用户习惯于将区域引用为数字,因此我将显示为数字并在工具提示中显示完整名称。这样我节省了空间并且没有滚动条。

What I did is put an hidden field with the tooltip value then in my current form event I have

我所做的是在我当前的表单事件中放置一个带有工具提示值的隐藏字段

txtRegionID.controltipText = hiddenRegionName

As I thought, the tooltip is set to the first value for every rows.

正如我所想,工具提示被设置为每一行的第一个值。

I guess it's not possible cause a continuous form is like a single form so it's always the same control and you can't change it's properties depending of the records.

我想这是不可能的,因为连续表单就像一个单一的表单,所以它总是相同的控件,并且您不能根据记录更改它的属性。

Am I right? Is there a way to do this?

我对吗?有没有办法做到这一点?

Thank you

谢谢

采纳答案by Fionnuala

As you can see in the illustration below, row 3 is selected and row 1 has a hover that shows Tip Three, which is wrong for row 1, but right for row 3. The status bar text shows Tip Three, which is the right tip for the row. The status bar will only show when a row is selected.

如下图所示,第 3 行被选中,第 1 行有一个悬停显示提示三,第 1 行是错误的,但第 3 行是正确的。状态栏文本显示提示三,这是正确的提示为行。状态栏只会在选择一行时显示。

Control Tips

控制技巧

Private Sub Form_Current()
    Me.ID.ControlTipText = Me.Tip
    Me.ID.StatusBarText = Me.Tip
End Sub

回答by Zev Spitz

Perhaps try the tooltip code from Stephen Lebans website- it allows you to have the tooltip display the current value in a continuous form (among other things).

也许尝试使用Stephen Lebans 网站上的工具提示代码- 它允许您让工具提示以连续形式(除其他外)显示当前值。

It may not work under newer versions of Access - 2007+. The author also has retired from things Access, so don't look for support there.

它可能不适用于较新版本的 Access - 2007+。作者也已经退出了 Access,所以不要在那里寻求支持。