变量失去了它的初始值 [英] Variable loses it's initial value

查看:62
本文介绍了变量失去了它的初始值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Access 2013。

Using Access 2013.

我在表单中定义了一个变量为
私有order_list_by为boolean

在Form> Open事件中,我将变量设置为True:

order_list_by = True

I have a variable defined in a form as
Private order_list_by as boolean
In the Form>Open event I set the variable to True:
order_list_by = True

但是第一次测试变量时,用户单击按钮时要更改表单的列表顺序,变量的值为False!

But the first time I test the variable, when a user clicks a button to change the list order of a form, the value of the variable is False!

所以我认为我可以通过更改为字符串变量并在一封信中告诉我当前的snooker Access列表顺序,但现在当用户第一次点击请求列表重新排序时,字符串为空, 变量=""。

So I thought I could snooker Access by changing to a string variable and put in a letter telling me the current list order, but now when the user clicks for the first time to request the list be reordered, the string is empty,  the variable = "".

表单打开时我在变量中存储的值发生了什么变化?有没有办法避免失去它?

What happened to the value I stored in the variable when the form opened? Is there a way to keep from losing it?

提前感谢您的帮助。  --Fred

Thanks in advance for any help.  --Fred

推荐答案


我在表格中定义的变量为$
私有order_list_by为布尔值

在Form> Open事件中,我将变量设置为True:

order_list_by = True

I have a variable defined in a form as
Private order_list_by as boolean
In the Form>Open event I set the variable to True:
order_list_by = True

嗨Fredrated451,

Hi Fredrated451,

如果将变量order_list_by声明为全局变量,没有私有变量,并且如果需要在一般模块中(不是表单的模块)?

What happens if you declare the variable order_list_by as a global variable, that is without the Private, and if necessary in a general module (not the form's module)?

Imb。


这篇关于变量失去了它的初始值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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