基于另外两个值在文本框中创建值 [英] Creating a value in a text box based on two other values

查看:44
本文介绍了基于另外两个值在文本框中创建值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是论坛和Access的新手,希望你可以使用Access 2000帮助解决以下问题:


我希望显示一个值基于另外两个值的文本框。

组合框称为Plant - 具有以下选项Plant 1,Plant 2,Plant 3

文本框 - 称为Cycle Time,它是一个时间字段(用户输入)

文本 - 称为Trigg Rep,这是我希望基于其他两个显示的值的地方,例如

如果选择了Plant 1,循环时间> 06:00显示是,否则留空

如果选择了工厂2,周期时间> 12:00显示是否则留空

如果选择工厂3且周期时间> 12: 00显示是否另外留空


我不知道如何去做或是否有可能做到这一点,任何帮助都会得到很好的赞赏。

PhilS

Hi everybody, I''m new to the forum and Access and hope you can help with the following question using Access 2000:

I would like to have a value displayed in a text box based upon two other values.
Combo box called Plant - with the following choices Plant 1, Plant 2, Plant 3
Text box - called Cycle Time which is a time field (user input)
Text - called Trigg Rep, this is where I would like the value displayed based on the other two e.g.
If Plant 1 is selected with a cycle time >06:00 display Yes otherwise leave blank
If Plant 2 is selected with a cycle time>12:00 display Yes otherwise leave blank
If Plant 3 is selected with a cycle time>12:00 display Yes otherwise leave blank

I have no idea how to go about this or whether it is possible to do it, any help would be grately appreciated.
PhilS

推荐答案


大家好,我是论坛和Access的新手,希望你能提供帮助使用Access 2000的以下问题:


我想在一个基于文本框的文本框中显示一个值pon另外两个值。

组合框称为Plant - 具有以下选项Plant 1,Plant 2,Plant 3

文本框 - 称为Cycle Time,它是一个时间字段(用户输入)

文本 - 称为Trigg Rep,这是我希望基于其他两个显示的值的地方,例如

如果选择了Plant 1,循环时间> 06:00显示是,否则留空

如果选择了工厂2,周期时间> 12:00显示是否则留空

如果选择工厂3且周期时间> 12: 00显示是否另外留空


我不知道如何去做或是否有可能做到这一点,任何帮助都会得到很好的赞赏。

PhilS
Hi everybody, I''m new to the forum and Access and hope you can help with the following question using Access 2000:

I would like to have a value displayed in a text box based upon two other values.
Combo box called Plant - with the following choices Plant 1, Plant 2, Plant 3
Text box - called Cycle Time which is a time field (user input)
Text - called Trigg Rep, this is where I would like the value displayed based on the other two e.g.
If Plant 1 is selected with a cycle time >06:00 display Yes otherwise leave blank
If Plant 2 is selected with a cycle time>12:00 display Yes otherwise leave blank
If Plant 3 is selected with a cycle time>12:00 display Yes otherwise leave blank

I have no idea how to go about this or whether it is possible to do it, any help would be grately appreciated.
PhilS



将以下代码放入表单的代码模块中。将来,建议您遵循Access标准命名约定,该约定规定(除其他外)具有标准前缀的混合大小写,Access对象的名称中没有空格或特殊字符。例如,Plant将是cboPlant,

Place the following code in your form''s code module. In the future, you are urged to follow Access standard naming conventions, which prescribe (among other things) mixed case with standard prefixes no spaces or special characters in the names of Access objects. For example, Plant would be cboPlant,

展开 | 选择 | Wrap | 行号



放置以下内容代码在表单的代码模块中。将来,建议您遵循Access标准命名约定,该约定规定(除其他外)具有标准前缀的混合大小写,Access对象的名称中没有空格或特殊字符。例如,Plant将是cboPlant,
Place the following code in your form''s code module. In the future, you are urged to follow Access standard naming conventions, which prescribe (among other things) mixed case with standard prefixes no spaces or special characters in the names of Access objects. For example, Plant would be cboPlant,
展开 | 选择 | Wrap | 行号



感谢您的回复很快。我为不使用这些约定而道歉,不幸的是我以前从未使用过代码,但将来会尝试使用。

我试图输入代码但是我收到了编译错误:预期:然后或者GoTo在以下行中:

如果Plant.Value = [Plant 1]和HoursAndMinutes([Cycle Time])> 06:00然后

结肠是灰色的,我怀疑可能是问题,但不知道如何克服这个问题。


非常感谢你的到目前为止帮助

PhilS
Thanks for responding quickly. I apologise for not using the conventions, unfortunatley I have never used code before, but will try to in the future.
I have tried to input the code but I am getting a Compile error: Expected: Then or GoTo in the following line:
If Plant.Value = [Plant 1] and HoursAndMinutes([Cycle Time])> 06:00 Then
The colon is greyed out which I suspect may be the problem, but do not know how to overcome this.

Many thanks for your help so far
PhilS



Phil,

无需道歉。这就是为什么我们在这里:给你指导和指导。


在时间周围加上报价像这样>>>>>>> " 06:00"


对每个循环时间执行相同的操作。

Phil,
No need for apology. That is why we are here: to give you guidance and direction.

Put quotes around the time Like this>>>>>>> "06:00"

do the same for each of the cycle times.


这篇关于基于另外两个值在文本框中创建值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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