当name在变量中时如何调用函数 [英] how to call a function when name is in a variable

查看:61
本文介绍了当name在变量中时如何调用函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里非常棘手。


我希望能够调用一个函数,但函数名在一个变量中。

代码是一个安全模块,查询存储

函数,表单,报告等名称以及某些组具有访问权限的表。表格,

报告等工作正常,因为我使用


DoCmd.OpenForm objectToRunName


但我该怎么办它当objectToRunName时有一个功能名称?


感谢您的帮助

Alan

really tricky one here.

I want to be able to call a function but the function name is in a variable.
The code is a security module that is querying a table that stores names of
functions, forms, reports etc and what access certain groups have. forms,
reports etc work fine as I use

DoCmd.OpenForm objectToRunName

but how do I do it when "objectToRunName" has a function name?

Thanks for any help
Alan

推荐答案

Alan,

你的意思是你的objectToRunName来自一个函数吗?

Dim strObject as string

strObject = YourFunction( )

DoCmd.OpenForm strObject


-

希望这会有所帮助

Arno R

Baldy <乔** @ smith.com> schreef在bericht新闻:41 ********** @ news.adelaide.pipenetworks.com ..
Alan,
Do you mean that your objectToRunName comes from a function?

Dim strObject as string
strObject=YourFunction()
DoCmd.OpenForm strObject

--
Hope this helps
Arno R
"Baldy" <Jo**@smith.com> schreef in bericht news:41**********@news.adelaide.pipenetworks.com.. .
这里真的很棘手。

我想要能够调用函数但函数名称在变量中。代码是一个
安全模块,它查询存储函数,表单,报告等名称的表以及某些组具有的访问权限。表格,报告等工作正常,因为我使用了

DoCmd.OpenForm objectToRunName

但是当objectToRunName时我该怎么做呢?有一个功能名称?

感谢您的帮助
Alan
really tricky one here.

I want to be able to call a function but the function name is in a variable. The code is a
security module that is querying a table that stores names of functions, forms, reports etc and
what access certain groups have. forms, reports etc work fine as I use

DoCmd.OpenForm objectToRunName

but how do I do it when "objectToRunName" has a function name?

Thanks for any help
Alan



您好Arno




objectToRunName中的值是我想要运行的函数的名称。


谢谢你您的回复

Alan


" Arno R" < AR **************** @ tiscali.nl>在消息中写道

news:41 ********************** @ dreader2.news.tiscal i.nl ...
Hi Arno

No

the value in objectToRunName is name of the function I want to run.

Thanks for your response
Alan

"Arno R" <ar****************@tiscali.nl> wrote in message
news:41**********************@dreader2.news.tiscal i.nl...
Alan,
你的意思是你的objectToRunName来自一个函数吗?

Dim strObject as string
strObject = YourFunction()
DoCmd。 OpenForm strObject

- 希望这有帮助
Arno R

" Baldy" <乔** @ smith.com> schreef in bericht
新闻:41 ********** @ news.adelaide.pipenetworks.com ..
Alan,
Do you mean that your objectToRunName comes from a function?

Dim strObject as string
strObject=YourFunction()
DoCmd.OpenForm strObject

--
Hope this helps
Arno R
"Baldy" <Jo**@smith.com> schreef in bericht
news:41**********@news.adelaide.pipenetworks.com.. .
这里真的很棘手。
变量中。代码是一个安全模块,用于查询存储函数,表单,报告等名称以及某些组具有访问权限的表格。表格,报告等工作正常,因为我使用了

DoCmd.OpenForm objectToRunName

但是当objectToRunName时我该怎么做呢?有一个功能名称?

感谢您的帮助
Alan
really tricky one here.

I want to be able to call a function but the function name is in a
variable. The code is a security module that is querying a table that
stores names of functions, forms, reports etc and what access certain
groups have. forms, reports etc work fine as I use

DoCmd.OpenForm objectToRunName

but how do I do it when "objectToRunName" has a function name?

Thanks for any help
Alan




2004年10月7日星期四21:54:39 +0930,Baldy <乔** @ smith.com>写道:
On Thu, 7 Oct 2004 21:54:39 +0930, "Baldy" <Jo**@smith.com> wrote:
您好Arno



objectToRunName中的值是我想要运行的函数的名称。

感谢您的回复
Alan
Hi Arno

No

the value in objectToRunName is name of the function I want to run.

Thanks for your response
Alan



您好

我已经在vb6中完成了这项工作但忘记了如何。

但是我在access97帮助文件(有用的东西)中看到它说:


您可以使用Eval函数来计算结果的表达式

在文本字符串或数值中。

您可以构造一个字符串,然后将其传递给Eval函数,就像

字符串是实际表达式一样。 Eval函数计算

字符串表达式并返回其值。例如,Eval(1 + 1)

返回2.

如果传递给Eval函数一个包含名称的字符串

函数,Eval函数返回函数的返回值。

例如,Eval(" Chr


Hi
I have done this in vb6 but forgotten how.
However I see in the access97 help file (useful things) it says:

You can use the Eval function to evaluate an expression that results
in a text string or a numeric value.
You can construct a string and then pass it to the Eval function as if
the string were an actual expression. The Eval function evaluates the
string expression and returns its value. For example, Eval("1 + 1")
returns 2.
If you pass to the Eval function a string that contains the name of a
function, the Eval function returns the return value of the function.
For example, Eval("Chr


这篇关于当name在变量中时如何调用函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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