愿望清单 [英] Wish List Item

查看:52
本文介绍了愿望清单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常使用OpenArgs将值传递给表单;如果

有一种类似的简单方法可以从被调用的表单中返回一个值,那就太好了。


Darryl Kerkeslager

I frequently use OpenArgs to pass a value to a form; it would be nice if
there was a similarly easy way to return a value from a called form.

Darryl Kerkeslager

推荐答案

将以下代码放入调用表单中:

DoCmd.OpenForm" NameOfFormToOpen" ,,,, acDialog," OpenArgsvalue"

如果IsLoaded(" NameOfFormToOpen")那么

我!MyField = Forms!NameOfFormToOpen!NameOfControlHoldingReturnV alue


<做什么>


结束如果


-

PC数据表

您的资源以获取Access,Excel和Word应用程序的帮助
re******@pcdatasheet.com
www.pcdatasheet.com

" Darryl Kerkeslager" <柯********* @ comcast.net>在消息中写道

news:gO ******************** @ comcast.com ...
Put the following code in the calling form:

DoCmd.OpenForm "NameOfFormToOpen",,,,,acDialog,"OpenArgsvalue "
If IsLoaded("NameOfFormToOpen") Then
Me!MyField = Forms!NameOfFormToOpen!NameOfControlHoldingReturnV alue

< Do Whatever >

End If

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Darryl Kerkeslager" <Ke*********@comcast.net> wrote in message
news:gO********************@comcast.com...
I经常使用OpenArgs将值传递给表单;如果
有一种类似的简单方法可以从被调用的表单中返回一个值,那就太好了。

Darryl Kerkeslager
I frequently use OpenArgs to pass a value to a form; it would be nice if
there was a similarly easy way to return a value from a called form.

Darryl Kerkeslager



Darryl Kerkeslager写了
"Darryl Kerkeslager" wrote
我经常使用OpenArgs将
值传递给表单;如果
有一种类似的简单方法可以从被调用的表单中返回一个值,那将会很不错。
I frequently use OpenArgs to pass a
value to a form; it would be nice if
there was a similarly easy way to
return a value from a called form.




除非打开表单; Modal",调用代码将继续执行
执行,并且表单打开的过程可能在表单关闭时完成

。这使得它充其量也是有问题的

从代码打开的表单返回一个值。


有一些变通办法,比如有总是存在,但是

看不见,将表格转换为可以存储返回值的控件,或者

为此目的使用带有一些公共变量的标准模块。没有

非常方便,我承认,因为有一个打开表单的函数,

等待,并在表单关闭时返回一些值。 />

Larry Linson

Microsoft Access MVP



Unless the Form is opened "Modal", the calling code will continue to
execute, and the Procedure from which the Form was opened may well be
completed when the Form is Closed. That makes it, at best, problematical to
return a value from a Form opened from code.

There are some "workarounds", such as having an always present, but
invisible, Form into a Control on which the return value could be stored, or
having a standard module with some Public variables for this purpose. None
is quite as convenient, I''ll admit, as having a function that opens a form,
waits, and returns some value when that form closes.

Larry Linson
Microsoft Access MVP


嗨拉里,

回复中最后一行的注释---


<< ....并在该表单关闭时返回一些值。 >>


如果表单已关闭,则无法返回第二个表单中的值。

表单'的可见属性必须设置为False,因此表单保持打开状态

返回一个值。


史蒂夫

PC数据表

" Larry Linson" <博***** @ localhost.not>在消息中写道

news:UT8pd.3765
Hi Larry,

A note to the last line in your response ---

<<....and returns some value when that form closes. >>

A value from the second form can not be returned if the form is closed. The
form''s visible property must be set to False so the form remains open to
return a value.

Steve
PC Datasheet
"Larry Linson" <bo*****@localhost.not> wrote in message
news:UT8pd.3765


这篇关于愿望清单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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