我怎样才能得到“常数”来自变量的行为(Constant magic)? [英] How can I get "CONSTANT" behavior from a variable (Constant magic)?

查看:60
本文介绍了我怎样才能得到“常数”来自变量的行为(Constant magic)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行访问2k;

之前说的是其他任何事情 - 是的,弗吉尼亚州,我知道你不能

使用一个变量来设置一个常数(那个这就是为什么它是恒定的"


但是 - 我的问题是 - 我想要一个常数,我可以设置一个

变量(一次)!!!

当我的应用程序启动时,系统会提示用户从列表中进行选择



我希望选择进入全局变量,并且在应用程序运行时永远不要更改
。这意味着如果应用程序

遇到意外错误 - 这个值不会丢失。


如果用户想要更改此值,他们应该关闭

申请并重启。


这是我正在寻找的行为.....


这种行为是否可能,如果是这样,怎么样?


BTW -

我应该提一下,我实际上已经成功实现了这个>
以编程方式将全局常量语句插入到globals

模块中! (插入语句当然使用了一个变量来定义语句)。问题是,(毫不奇怪),这不能在运行时应用程序中完成

....; o)


想法或讨论?


TIA !!

Bob

running access 2k;
And before anything else is said - "Yes, Virginia, I know you can NOT
use a variable to set a constant (that''s why it''s constant)".

BUT - my problem is - I want a constant, that I can set from a
variable (one time)!!!

When my application starts, the user is prompted to make a selection
from a list.
I want that selection to go into a global variable, and NEVER CHANGE
while the application is running. This means that if the application
encounters an unexpected error - this value is NOT lost.

If the user wants to change this value, they should have to close the
application and restart.

This is the BEHAVIOR I''m looking for.....

Is this behavior possible, and if so, how?

BTW -
I should mention, that I successfully accomplished this by actually
programatically inserting a global constant statement into a "globals
module" ! (the insertion statement, of course used a variable to
define the statement). Problem is, (no surprise), this can NOT be done
in a run-time application.... ;o)

thoughts or discussion?

TIA!!
Bob

推荐答案

2月4日星期一2008 14:25:53 -0800(太平洋标准时间), bo*******@gmail.com 写道:
On Mon, 4 Feb 2008 14:25:53 -0800 (PST), bo*******@gmail.com wrote:

>运行访问权限2k;
之前还有其他说法 - 是的,弗吉尼亚州,我知道你不能使用
一个变量来设置一个常量(这就是为什么它是常数)"

但是 - 我的问题是 - 我想要一个常数,我可以从一个
设置变量(一次)!!!

当我的应用程序启动时,系统会提示用户从列表中进行选择。
我希望选择进入全局应用程序运行时,变量,并且永远不会改变。这意味着如果应用程序遇到意外错误 - 此值不会丢失。

如果用户想要更改此值,则必须关闭
应用程序,重新开始。

这是我正在寻找的行为.....

这种行为是否可行,若然,怎么样?

我应该提一下,我通过以编程方式将全局常量语句插入到全局模块模块中来成功地实现了这一点。 ! (插入语句当然使用了一个变量来定义语句)。问题是,(毫不奇怪),这不能在运行时应用程序中完成....; o)

想法或讨论?

TIA !!
Bob
>running access 2k;
And before anything else is said - "Yes, Virginia, I know you can NOT
use a variable to set a constant (that''s why it''s constant)".

BUT - my problem is - I want a constant, that I can set from a
variable (one time)!!!

When my application starts, the user is prompted to make a selection
from a list.
I want that selection to go into a global variable, and NEVER CHANGE
while the application is running. This means that if the application
encounters an unexpected error - this value is NOT lost.

If the user wants to change this value, they should have to close the
application and restart.

This is the BEHAVIOR I''m looking for.....

Is this behavior possible, and if so, how?

BTW -
I should mention, that I successfully accomplished this by actually
programatically inserting a global constant statement into a "globals
module" ! (the insertion statement, of course used a variable to
define the statement). Problem is, (no surprise), this can NOT be done
in a run-time application.... ;o)

thoughts or discussion?

TIA!!
Bob



您可以创建一个自定义属性来存储值,并在打开

数据库时将其播种。


创建属性(仅限一次)

CurrentDb = CreateProperty(" MyProperty",dbLong)


在启动时播种属性。

CurrentDb.Properties(" MyProperty")= 12345


阅读酒店。

MyVariable = CurrentDb.Properties!MyProperty


Wayne Gillespie

Gosford NSW Australia

You could create a custom property to store the value and seed it on opening the
database.

Create the property (once only)
CurrentDb = CreateProperty("MyProperty", dbLong)

Seed the property on startup.
CurrentDb.Properties("MyProperty") = 12345

Read the property.
MyVariable = CurrentDb.Properties!MyProperty


Wayne Gillespie
Gosford NSW Australia


让我觉得简单的方法就是把它放在一张桌子里。好的我知道你需要一个

ELookup或DLookup来取回它


Phil


< bo ** *****@gmail.com在留言中写道

新闻:cd **************************** ****** @ d21g2000 prf.googlegroups.com ...
Strikes me the simple way is to put it in a table. OK I know you need an
ELookup or DLookup to retrieve it

Phil

<bo*******@gmail.comwrote in message
news:cd**********************************@d21g2000 prf.googlegroups.com...

运行访问2k;

之前说的是其他任何内容 - 是的,弗吉尼亚州,我知道你不能

使用一个变量来设置一个常数(这就是为什么它不变)。


但是 - 我的问题是 - 我想要一个常数,我可以设置一个

变量(一次)!!!


我的应用程序启动后,系统会提示用户从列表中进行选择



我希望选择进入全局变量,并且永远不要更改
应用程序运行时
。这意味着如果应用程序

遇到意外错误 - 这个值不会丢失。


如果用户想要更改此值,他们应该关闭

申请并重启。


这是我正在寻找的行为.....


这种行为是否可能,如果是这样,怎么样?


BTW -

我应该提一下,我实际上已经成功实现了这个>
以编程方式将全局常量语句插入到globals

模块中! (插入语句当然使用了一个变量来定义语句)。问题是,(毫不奇怪),这不能在运行时应用程序中完成

....; o)


想法或讨论?


TIA !!

Bob
running access 2k;
And before anything else is said - "Yes, Virginia, I know you can NOT
use a variable to set a constant (that''s why it''s constant)".

BUT - my problem is - I want a constant, that I can set from a
variable (one time)!!!

When my application starts, the user is prompted to make a selection
from a list.
I want that selection to go into a global variable, and NEVER CHANGE
while the application is running. This means that if the application
encounters an unexpected error - this value is NOT lost.

If the user wants to change this value, they should have to close the
application and restart.

This is the BEHAVIOR I''m looking for.....

Is this behavior possible, and if so, how?

BTW -
I should mention, that I successfully accomplished this by actually
programatically inserting a global constant statement into a "globals
module" ! (the insertion statement, of course used a variable to
define the statement). Problem is, (no surprise), this can NOT be done
in a run-time application.... ;o)

thoughts or discussion?

TIA!!
Bob



bo ******* @ gmail.com 写道:

运行访问2k;

之前说的是其他任何东西 - 是的,弗吉尼亚,我知道你不能

使用一个变量来设置一个常数(那个'这就是它为什么不变的原因。

但是 - 我的问题是 - 我想要一个常数,我可以设置一个

变量(一次)!!!


当我的应用程序启动时,系统会提示用户从列表中进行选择



我希望选择进入全局变量,并且在应用程序运行时永远不要更改
。这意味着如果应用程序

遇到意外错误 - 这个值不会丢失。


如果用户想要更改此值,他们应该关闭

申请并重启。


这是我正在寻找的行为.....


这种行为是否可能,如果是这样,怎么样?


BTW -

我应该提一下,我实际上已经成功实现了这个>
以编程方式将全局常量语句插入到globals

模块中! (插入语句当然使用了一个变量来定义语句)。问题是,(毫不奇怪),这不能在运行时应用程序中完成

....; o)


想法或讨论?


TIA !!

Bob
running access 2k;
And before anything else is said - "Yes, Virginia, I know you can NOT
use a variable to set a constant (that''s why it''s constant)".

BUT - my problem is - I want a constant, that I can set from a
variable (one time)!!!

When my application starts, the user is prompted to make a selection
from a list.
I want that selection to go into a global variable, and NEVER CHANGE
while the application is running. This means that if the application
encounters an unexpected error - this value is NOT lost.

If the user wants to change this value, they should have to close the
application and restart.

This is the BEHAVIOR I''m looking for.....

Is this behavior possible, and if so, how?

BTW -
I should mention, that I successfully accomplished this by actually
programatically inserting a global constant statement into a "globals
module" ! (the insertion statement, of course used a variable to
define the statement). Problem is, (no surprise), this can NOT be done
in a run-time application.... ;o)

thoughts or discussion?

TIA!!
Bob



为什么不将值存储在表中?您可以在每日,每周,每月,每年的时间段内更改一个或多个字段



创建您想要的字段。将1条记录添加到表中。根据需要插入一些

值。然后将一条记录更新到您心中的内容。


WorkIt
http://www.youtube.com/watch?v=KEuLlqDQDAw


这篇关于我怎样才能得到“常数”来自变量的行为(Constant magic)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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