向后代码有效吗?为什么? [英] Backwards code works Forwards? Why?

查看:66
本文介绍了向后代码有效吗?为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我快速将这些代码放在一起,以测试当我的文本框(采购订单编号)为空时它是否会禁用我的某些功能OnChange ...以及当我将数据添加到我的字段时它是否会启用这些功能。有趣的是,如果您阅读代码,它实际上是反向运行!当我的字段为空时,假设禁用...而是启用...为什么?所以我把我的代码放在与我想要的相反的地方并且它有效!?!?!我不介意我的代码在逻辑上反向,只要我得到结果我正在寻找......但是......我不明白...... ???? ;-)


前锋:(反向工作并在Null时启用功能)

I quickly put this code together to test if it would disable some of my functions OnChange when my text box (purchase order number) is empty...and if it would enable those functions when I added data to my field. The funny thing is that if you read the code it actually runs in reverse! When my field is null it is suppose to disable...instead it enables...Why? So I put my code in to do the opposite of what I want and it works!?!?! I don''t mind having my code in logical reverse as long as I get the results I''m looking for...but...I don''t get it....???? ;-)


Forwards: (works in reverse and enables features when Null)

展开 | 选择 | Wrap | 行号

推荐答案

您好。


我建议您执行一个小实验 - 在表单上添加两个控件并在PurchaseOrderNumber_Change事件处理程序中分配PurchaseOrderNumber .Value属性和PurchaseOrderNumber.Text属性值。


问候,

Fish。
Hello.

I suggest you to perform a little experiment - add two controls on the form and in PurchaseOrderNumber_Change event handler assign PurchaseOrderNumber.Value property and PurchaseOrderNumber.Text property values to them.

Regards,
Fish.


@FishVal


Ooook that很有意思.....所以......那是什么让我看到。有点离奇,但我不知道这些结果告诉我的是什么... = - )




所以,哪里做了你学习Access吗?


学习访问?谁?我?"
@FishVal
Ooook that was interesting.....So....what is that showing me. A little bizarre, but I have no idea what these results tell me... =-)




"So, where did you learn Access?"

"Learn Access? Who? Me?"


@MyWaterloo


我想这可以解释为什么你的代码的行为方式不是你不期待。


亲切的问候,

Fish。
@MyWaterloo
I guess it explains why your code behaves in a way you don''t expect.

Kind regards,
Fish.


这篇关于向后代码有效吗?为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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