常规全局变量帮助 [英] General Global Variable Help

查看:60
本文介绍了常规全局变量帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我有兴趣为前端创建访问MDE ..在尝试创建报表和通用表单时,我遇到了问题。我需要使用某些字段/值,具体取决于最终用户在字段上的操作...


我想我只是在寻求帮助设置全局变量,例如...


我需要用户能够在多个字段上按地址研究位置,并且我可以轻松创建一个按钮来打开一个''位置查询''表格,他们可以通过邮政编码,街道,城市等搜索。但是,我希望他们能够点击一个按钮,并输入他们找到的字段的ID并输入它进入以前的形式...


我可以用绝对路径做到这一点,但正如我所说,有许多表格需要该位置的ID,但我不想要必须为每个不同的表格反复创建表单。


这是一个特定的案例,我有许多不同的形式需要类似的全球化变量..有没有人有任何建议或者知道任何可以指导我的网站他正确的方向?这个网站引导我相当远。

解决方案


大家好,

我有兴趣为前端创建访问MDE ..在尝试创建报表和通用表单时,我遇到了问题。我需要使用某些字段/值,具体取决于最终用户在字段上的操作...


我想我只是在寻求帮助设置全局变量,例如...


我需要用户能够在多个字段上按地址研究位置,并且我可以轻松创建一个按钮来打开一个''位置查询''表格,他们可以通过邮政编码,街道,城市等搜索。但是,我希望他们能够点击一个按钮,并输入他们找到的字段的ID并输入它进入以前的形式...


我可以用绝对路径做到这一点,但正如我所说,有许多表格需要该位置的ID,但我不想要必须为每个不同的表格反复创建表单。


这是一个特定的案例,我有许多不同的形式需要类似的全球化变量..有没有人有任何建议或者知道任何可以指导我的网站他正确的方向?这个网站引导我相当远。

这比你想象的要简单得多:

  1. To创建一个变量''Global''在标准代码模块中将其声明为公共及其相关的数据类型。
  2. 保持标准命名约定为全局变量加上g,然后是数据类型变量。
  3. 下面列出了几个例子。
  4. 如果您有任何疑问或问题,请告诉我们。
  5. 注意!因为这些变量是全局,所以现在可以在应用程序的任何地方无意中访问和/或修改它们。

展开 | 选择 | 换行 | 行号


我理解全局变量,但是如何通过应用程序,案例和指向会话保留它们的值?



我理解全局变量,但是如何通过应用程序,案例和指向会话保留它们的价值呢?



从初始化到关闭应用程序的那一刻起,它们将保留其值(持久)并可以被引用。例如,引用绝对路径的全局变量:

  1. 声明全局变量。

    展开 | 选择 | Wrap | 行号

Hello everyone,

I am interested in creating an access MDE for a front-end.. In attempting to create reports and generalized forms, I''ve run into a problem. There are certain fields/values that I need to use, depending on what the end-user would be doing on a field...

I guess I''m just looking for help setting up global variables, for example...

I need the user to be able to research a location by address, on multiple fields, and I can easily create a button to open up a ''Location Inquiry'' form, which they can search by zip code, street, city, etc.. However, I want them to be able to click a button and for it to enter the ID of the field they found and enter it into the previous form...

I can do that with absolute paths, but as I said, there are many forms that need the ID for the location, but I do not want to have to create the form over and over for each different form.

This is one specific case, and I have many different forms that require similar globalized variables.. Does anyone have any suggestions or know of any sites that can guide me in the right direction? This site has guided me rather far.

解决方案

Hello everyone,

I am interested in creating an access MDE for a front-end.. In attempting to create reports and generalized forms, I''ve run into a problem. There are certain fields/values that I need to use, depending on what the end-user would be doing on a field...

I guess I''m just looking for help setting up global variables, for example...

I need the user to be able to research a location by address, on multiple fields, and I can easily create a button to open up a ''Location Inquiry'' form, which they can search by zip code, street, city, etc.. However, I want them to be able to click a button and for it to enter the ID of the field they found and enter it into the previous form...

I can do that with absolute paths, but as I said, there are many forms that need the ID for the location, but I do not want to have to create the form over and over for each different form.

This is one specific case, and I have many different forms that require similar globalized variables.. Does anyone have any suggestions or know of any sites that can guide me in the right direction? This site has guided me rather far.

It''s a lot simpler than you think:

  1. To make a variable ''Global'' Declare it as Public in a Standard Code Module along with its associated Data Type.
  2. Keep the Standard Naming Convention of prefacing the Global Variable with g, then the Data Type of the Variable.
  3. I''ve included several examples below.
  4. If you have any questions or problems, please let us know.
  5. NOTE! Because these Variables are ''Global'', they can now be inadvertently accessed and/or modified anywhere within your application.

Expand|Select|Wrap|Line Numbers


I understand global variables, but how do you have them retain their value througout the application, case and point a session?


I understand global variables, but how do you have them retain their value througout the application, case and point a session?

From the moment that they are initialized, until the closing of your Application, they will retain their value (persist) and can be referenced. Case in point, a Global Variable referencing an Absolute Path:

  1. Declare the Global Variable.

    Expand|Select|Wrap|Line Numbers


这篇关于常规全局变量帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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