控制源中的三种可能性 [英] Three Possibilities in a Control Source

查看:70
本文介绍了控制源中的三种可能性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨...


我在MS Access 2000中工作,我有一个字段,根据其他字段的值,我希望该字段返回一个特定的字。理想情况下,我希望声明在控件源中,但我已经开始尝试在VB中进行编码。看来我的问题在于在...之间。我的代码在第三段中的陈述。我在下面发布了我的代码。我没有在论坛上找到答案,所以任何帮助将不胜感激。我相信这不是解决这个问题的最佳方式..........


如果([ScoreCard查询]![1/3]前臂T评分]或[记分卡查询]![脊柱T评分]或[记分卡查询]![总髋部T评分]<" -2.5)然后Me.BoneDensityResult =骨质疏松症


If([ScoreCard Query]![1/3 Forearm T score]或[ScoreCard Query]![Ap spine T Score]或[ScoreCard Query]![Total Hip T Score] -1.0"和-2.5")然后Me.BoneDensityResult =Osteopenia


如果([ScoreCard查询]![1/3前臂T得分]或[ ScoreCard Query]![Ap spine T Score]或[ScoreCard Query]![Total Hip T Score]>1.0)然后Me.BoneDensityResult =Normal


EndIF


结束Sub

解决方案


嗨...


我在MS Access 2000中工作,我有一个字段,取决于其他的值字段,我希望字段返回一个特定的单词。理想情况下,我希望声明在控件源中,但我已经开始尝试在VB中进行编码。看来我的问题在于在...之间。我的代码在第三段中的陈述。我在下面发布了我的代码。我没有在论坛上找到答案,所以任何帮助将不胜感激。我相信这不是解决这个问题的最佳方式..........


展开 | 选择 | Wrap | 行号

Scott ...


数据输入为数值(Double)。 ScoreCard查询是一个查询。基本上,我在表单上输入数字,并在报表中输出。在两者之间,我根据表单中的信息从查询中提取数据。上面的代码试图通过使用IF语句来操作字段输出。


非常感谢....


抱歉拿走这么久......我假设你想要大于-2.5的三个T分数中的任何一个显示为骨质疏松症吗?从-1到-2.5的结果将显示Osteopenia,结果小于-1将显示Normal。


此函数在我的测试数据库中对测试数据工作正常。

展开 | 选择 | Wrap | 行号


Hi...

I am working in MS Access 2000 and I have a field where depending on the values of other fields, I would like the field to return a particular word. Ideally, I would like the statement to be in the control source, but I have moved to trying to have the coding in VB. It seems my problem is with the "between" statement in my code in the third paragraph. I have posted my code below. I did not find an answer on the forum, so any help would be appreciated. I am sure this is not the optimal way to go about this..........


If ([ScoreCard Query]![1/3 Forearm T score] Or [ScoreCard Query]![Ap spine T Score] Or [ScoreCard Query]![Total Hip T Score] < "-2.5") Then Me.BoneDensityResult = "Osteoperosis"

If ([ScoreCard Query]![1/3 Forearm T score] Or [ScoreCard Query]![Ap spine T Score] Or [ScoreCard Query]![Total Hip T Score] between "-1.0" and "-2.5") Then Me.BoneDensityResult = "Osteopenia"

If ([ScoreCard Query]![1/3 Forearm T score] Or [ScoreCard Query]![Ap spine T Score] Or [ScoreCard Query]![Total Hip T Score] > "1.0") Then Me.BoneDensityResult = "Normal"

EndIF

End Sub

解决方案

Hi...

I am working in MS Access 2000 and I have a field where depending on the values of other fields, I would like the field to return a particular word. Ideally, I would like the statement to be in the control source, but I have moved to trying to have the coding in VB. It seems my problem is with the "between" statement in my code in the third paragraph. I have posted my code below. I did not find an answer on the forum, so any help would be appreciated. I am sure this is not the optimal way to go about this..........


Expand|Select|Wrap|Line Numbers


Scott...

The data is entered as numeric values (Double). The ScoreCard Query is a query. Basically, I enter numbers on a form, and have the output in a report. In between, I pull the data from a query based on information from the form. The code above is an attempt to manipulate the field output by using the IF statements.

Thanks so much....


Sorry to take so long... I''m assuming that you want any result on any of the three T Scores greater than -2.5 to show as Osteoporosis? Results from -1 to -2.5 inclusive will show Osteopenia, and results less than -1 will show Normal.

This function works fine in my test db on test data.

Expand|Select|Wrap|Line Numbers


这篇关于控制源中的三种可能性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆