打开带有'openargs'的表单 [英] Opening a form with 'openargs'

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

问题描述

您好。我正在尝试使用

docmd.openform操作的''openargs''参数打开一个表单。问题是我想传递

表格中的一些字符(字符串)和整数数据。我的计划是

将数据与字段之间的分隔符(,)连接起来。然后在

的Form_Open()过程中我将解析数据并填充一些全局的b $ b变量,这些变量可用于填充表格中的某些数据。 />
没有记录(我想出一个空白的新记录)。

问题就是整数数据。有可能做我想要的吗?如果

那么,怎么样?

我是一名大型机程序员,他涉猎MS / Access和VBA以获得乐趣和

我正在努力整理一个实用程序,我们这里的一些人在工作中可以使用
来跟踪''项目'中''任务''在''版本中的发布br />
软件''。这样我们这些发布管理的人就可以生成所有要求我们的报告(和excel电子表格)。

唯一的问题..我必须先将它展示给我的

老板。


有什么建议吗?还是问题?如果你需要
,我会很高兴得到更具体的信息。只需要离开。


谢谢。

Sue



***通过Developersdex发送< a rel =nofollowhref =http://www.developersdex.comtarget =_ blank> http://www.developersdex.com ***

Don 只是参加USENET ......获得奖励!

Hi. I am trying to open a form using ''openargs'' parameter of the
docmd.openform action. The problem is that I would like to pass the
form some character (string) and integer data. My plan was to
concatenate the data with delimeters (",") between the fields. Then in
the Form_Open( ) procedure I would parse the data and fill some "global"
variables that could be used to populate some data in the form when
there are no records (and I come up with a blank New Record). The
problem is then the integer data. Is it possible to do what I want? If
so, how?

I''m a mainframe programmer who dabbles in MS/Access and VBA for fun and
I''m trying to put together a utility that some of us here at work can
use to keep track of ''tasks'' within a ''project'' within a ''release of
software''. This way those of us who do ''Release Management'' could
generate all the reports (and excel spreadsheets) that are asked of us.
The only problem ... I have to get it working before I show it to my
bosses.

Any suggestions? Or Questions? I''ll gladly get more specific if you
need. Just ask away.

Thanks.
Sue


*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!

推荐答案

更好的方法是通过字符串传递OpenArgs然后

在你的第一个表单上放置一个多选列表框,用户可以在其中选择

整数数据,然后将整数数据传递给列表框中的第二个表单。 br />
-

PC数据表

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

" Susan Bricker" < SB **** @ att.net>在消息中写道

news:40 ********************* @ news.frii.net ...
A better way to do this might be to only pass the string via OpenArgs and then
put a multiselect listbox on your first form where the users can select the
Integer data and then pass the Integer data to the second form from the listbox.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Susan Bricker" <sb****@att.net> wrote in message
news:40*********************@news.frii.net...
嗨。我正在尝试使用
docmd.openform操作的''openargs''参数打开表单。问题是我想通过
形式传递一些字符(字符串)和整数数据。我的计划是将数据与字段之间的分隔符(,)连接起来。然后在Form_Open()过程中,我将解析数据并填充一些全局变量,这些变量可用于在没有记录时填充表单中的某些数据(和我拿出一张空白的新纪录)。那么
问题就是整数数据。有可能做我想要的吗?如果
那么,怎么样?

我是一个大型机程序员,他在MS / Access和VBA中涉足到乐趣和
我正在尝试将一些实用工具放在一起我们这里的工作可以用来跟踪''软件'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''通过这种方式,我们这些发布管理的人可以生成我们所要求的所有报告(以及优秀的电子表格)。
唯一的问题......我必须先让它工作我把它展示给我的
老板。

有什么建议吗?还是问题?如果您需要,我很乐意更具体。只要问一下。

谢谢。
Sue


***通过Developersdex发送 http://www.developersdex.com ***
不要只是参加USENET ......获得奖励!
Hi. I am trying to open a form using ''openargs'' parameter of the
docmd.openform action. The problem is that I would like to pass the
form some character (string) and integer data. My plan was to
concatenate the data with delimeters (",") between the fields. Then in
the Form_Open( ) procedure I would parse the data and fill some "global"
variables that could be used to populate some data in the form when
there are no records (and I come up with a blank New Record). The
problem is then the integer data. Is it possible to do what I want? If
so, how?

I''m a mainframe programmer who dabbles in MS/Access and VBA for fun and
I''m trying to put together a utility that some of us here at work can
use to keep track of ''tasks'' within a ''project'' within a ''release of
software''. This way those of us who do ''Release Management'' could
generate all the reports (and excel spreadsheets) that are asked of us.
The only problem ... I have to get it working before I show it to my
bosses.

Any suggestions? Or Questions? I''ll gladly get more specific if you
need. Just ask away.

Thanks.
Sue


*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!



OpenArgs非常有限。是的,你可以连接字符串,然后解析它们

退出,但是很有可能你很快就会想要更多,字符串

lenght是有超过OpenArgs最大值的危险。


我开始做的是创建一个名为

gcolPassArgs的全局集合变量。在打开我要传递的表单或报告之前,我创建了一个参数集合,并将其放在全局

变量中。在窗体或报表的Open事件中,从

globable变量中获取集合,然后处理其内容。重要的是要完全阅读集合或将其复制到Open事件中的私有引用变量

处理程序,因为其他代码可能随时重写数据以便传递

参与其他形式或报告。


在某个标准模块中...


昏暗gcolPassArgs作为VBA.Collection


在打开表单的代码中...

Dim colFormParams作为VBA.Collection

设置colFormParams = New VBA.Collection

colFormParams.Add Key:=" Arg1",Item:=" ABCD"

colFormParams.Add Key:= Arg2,项目:= 123

设置gcolPassArgs = colFormParams

DoCmd.OpenForm" frmFoo"

在frmFoo ...


Private Sub Form_Open(取消为整数)

Me!txtData1 = gcolPassArgs(" Arg1")

Me!txtData2 = gcolPassArgs(" Arg2")

结束子

2004年2月24日18:08:41 GMT,Susa n Bricker< sb **** @ att.net>写道:
OpenArgs is pretty limited. Yes, you can concatenate strings, then parse them
back out, but then there''s a good chance you''ll soon want more, and the string
lenght is in danger of exceeding the maximum for OpenArgs.

What I''ve started doing is to make a global collection variable called
gcolPassArgs. Before opening a form or report to which I want to pass
arguments, I create a colleciton of arguments, and place it in the global
variable. In Open event for the form or report, grab the collection from the
globable variable, then process its contents. It is important to fully read
the colleciton or copy it to a private reference variable in the Open event
handler since other code may rewrite the data at any time in order to pass
arguments to some other form or report.

In a standard module somewhere...

Dim gcolPassArgs As VBA.Collection

In the code that opens the form...

Dim colFormParams As VBA.Collection
Set colFormParams = New VBA.Collection
colFormParams.Add Key:="Arg1", Item:="ABCD"
colFormParams.Add Key:="Arg2", Item:=123
Set gcolPassArgs = colFormParams
DoCmd.OpenForm "frmFoo"
In frmFoo...

Private Sub Form_Open(Cancel As Integer)
Me!txtData1 = gcolPassArgs("Arg1")
Me!txtData2 = gcolPassArgs("Arg2")
End Sub
On 24 Feb 2004 18:08:41 GMT, Susan Bricker <sb****@att.net> wrote:
嗨。我正在尝试使用
docmd.openform操作的''openargs''参数打开表单。问题是我想通过
形式传递一些字符(字符串)和整数数据。我的计划是将数据与字段之间的分隔符(,)连接起来。然后在Form_Open()过程中,我将解析数据并填充一些全局变量,这些变量可用于在没有记录时填充表单中的某些数据(和我拿出一张空白的新纪录)。那么
问题就是整数数据。有可能做我想要的吗?如果
那么,怎么样?

我是一个大型机程序员,他在MS / Access和VBA中涉足到乐趣和
我正在尝试将一些实用工具放在一起我们这里的工作可以用来跟踪''软件'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''通过这种方式,我们这些发布管理的人可以生成我们所要求的所有报告(以及优秀的电子表格)。
唯一的问题......我必须先让它工作我把它展示给我的
老板。

有什么建议吗?还是问题?如果您需要,我很乐意更具体。只要问一下。

谢谢。
Sue


***通过Developersdex发送 http://www.developersdex.com ***
不要只是参加USENET ......获得奖励!
Hi. I am trying to open a form using ''openargs'' parameter of the
docmd.openform action. The problem is that I would like to pass the
form some character (string) and integer data. My plan was to
concatenate the data with delimeters (",") between the fields. Then in
the Form_Open( ) procedure I would parse the data and fill some "global"
variables that could be used to populate some data in the form when
there are no records (and I come up with a blank New Record). The
problem is then the integer data. Is it possible to do what I want? If
so, how?

I''m a mainframe programmer who dabbles in MS/Access and VBA for fun and
I''m trying to put together a utility that some of us here at work can
use to keep track of ''tasks'' within a ''project'' within a ''release of
software''. This way those of us who do ''Release Management'' could
generate all the reports (and excel spreadsheets) that are asked of us.
The only problem ... I have to get it working before I show it to my
bosses.

Any suggestions? Or Questions? I''ll gladly get more specific if you
need. Just ask away.

Thanks.
Sue


*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!






Susan Bricker写道:
Susan Bricker wrote:
嗨。我正在尝试使用
docmd.openform操作的''openargs''参数打开表单。问题是我想通过
形式传递一些字符(字符串)和整数数据。我的计划是将数据与字段之间的分隔符(,)连接起来。然后在Form_Open()过程中,我将解析数据并填充一些全局变量,这些变量可用于在没有记录时填充表单中的某些数据(和我拿出一张空白的新纪录)。那么
问题就是整数数据。有可能做我想要的吗?如果
那么,怎么样?

我是大型机程序员,他们涉猎MS / Access和VBA以获得乐趣
Hi. I am trying to open a form using ''openargs'' parameter of the
docmd.openform action. The problem is that I would like to pass the
form some character (string) and integer data. My plan was to
concatenate the data with delimeters (",") between the fields. Then in
the Form_Open( ) procedure I would parse the data and fill some "global"
variables that could be used to populate some data in the form when
there are no records (and I come up with a blank New Record). The
problem is then the integer data. Is it possible to do what I want? If
so, how?

I''m a mainframe programmer who dabbles in MS/Access and VBA for fun




好练习。


为什么整数是一个问题?就好像它是一个字符串(在它的OpenArgs

航程中)然后使用隐式或

显式类型转换将字符串转换为整数(隐式不起作用?从不然后请参阅

Int()CInt()CLng()


-

Bas Cost Budde
http://www.heuveltop.org/BasCB

但域名为nl



Good practice.

Why is integer a problem? Act as if it is a string (during its OpenArgs
voyage) and then convert the string into an integer using implicit or
explicit type conversion (does implicit not work? Never mind then) See
Int() CInt() CLng()

--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl


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

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