A2K - 将多个值传递给弹出窗体 [英] A2K - passing more than one value into a popup form

查看:46
本文介绍了A2K - 将多个值传递给弹出窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显然你只能用一个值来做这个,即调用

MyAssetLocationZoom(Me!txtLocation," Amend data")


这样运行;


Public Sub MyAssetLocationZoom(ctl As Control,formName As String)


On Error GoTo err_zoom


strFormName = formName


DoCmd.openform" frmAssetLocZoom",,,, acDialog,ctl.Value

如果是Forms!frmAssetLocZoom.Tag<> ; "取消]那么

ctl = Forms!frmAssetLocZoom!txtText

结束如果

DoCmd.Close acForm,frmAssetLocZoom

exit_err_zoom:

退出Sub


err_zoom:

MsgBox Err.Description& " " &安培; Err.number

恢复exit_err_zoom

结束子


为了把它放到上下文中,我有一个带有单个字段的表单。用户

选择一个值并单击编辑。出现一个弹出窗体,此值准备好

进行编辑。上面的代码可以很好地处理所有这些。


我很乐意用多个值来做这件事。有任何想法吗?我是

从Access 2000开发者手册查看taggedvalues而不是
运气好。


谢谢

Martin

Apparently you can only do this with one value i.e Call
MyAssetLocationZoom(Me!txtLocation, "Amend data")

This runs;

Public Sub MyAssetLocationZoom(ctl As Control, formName As String)

On Error GoTo err_zoom

strFormName = formName

DoCmd.openform "frmAssetLocZoom", , , , , acDialog, ctl.Value
If Forms!frmAssetLocZoom.Tag <> "Cancel" Then
ctl = Forms!frmAssetLocZoom!txtText
End If
DoCmd.Close acForm, "frmAssetLocZoom"

exit_err_zoom:
Exit Sub

err_zoom:
MsgBox Err.Description & " " & Err.number
Resume exit_err_zoom
End Sub

To put this into context, I have a form with a single field. The user
selects a value and clicks edit. A popup form appears with this value ready
to be edited. The above code handles all of that nicely.

I''d love to be able to do this with more than one value. Any ideas? I''m
looking at taggedvalues from the Access 2000 Developers Handbook but not
having much luck.

thanks
Martin

推荐答案

我刚才发布了一些空气代码。它还没有出现。要

确保它立即发布,我会发布其他内容:


Sub blah2()


''表单是调用FFDBACheques

''它有一个模块

''或者至少将HasModule属性设置为True


使用Form_FFDBACheques

.Visible = False

.txtfldDate = VBA.Date

.txtfldAmount = 1000

.Tag =" Whatever"

.Visible = True

结束


End Sub
< br $>
-

Lyle Fairfield
I posted some air code in response a while ago. It hasn''t shown up yet. To
assure that it does so immediately, I''ll post something else:

Sub blah2()

'' the form is call FFDBACheques
'' it has a module
'' or at least the HasModule Property set to True

With Form_FFDBACheques
.Visible = False
.txtfldDate = VBA.Date
.txtfldAmount = 1000
.Tag = "Whatever"
.Visible = True
End With

End Sub

--
Lyle Fairfield


航空代码(假设frmAssetLocZoom的HasModule属性已设置为

true);


使用Form_frmAssetLocZoom

.Visible = False

.SomeControl.Value = 42

.SomeOtherControl.Value ="你好,我是狮子座。什么是你的标志?"

....无论

。可观=真

结束

Air code (assumes frmAssetLocZoom''s HasModule property has been set to
true);

With Form_frmAssetLocZoom
.Visible = False
.SomeControl.Value = 42
.SomeOtherControl.Value = "Hi there, I am a Leo. What''s your sign?"
.... whatever
.Visible = True
End With


Lyle Fairfield写道:
Lyle Fairfield wrote:
空气代码(假设frmAssetLocZoom的HasModule属性已设置为
true);

使用Form_frmAssetLocZoom
.Visible = False
。SomeControl.Value = 42
。SomeOtherControl.Value ="我是狮子座。什么是你的标志?
....无论
.Visible = True
结束
Air code (assumes frmAssetLocZoom''s HasModule property has been set to
true);

With Form_frmAssetLocZoom
.Visible = False
.SomeControl.Value = 42
.SomeOtherControl.Value = "Hi there, I am a Leo. What''s your sign?"
.... whatever
.Visible = True
End With




嗯,这个结构在哪里?此外,我正在尝试将基础表单的

值分配给弹出窗体,所以;


popupform.txt1 = mainform.txtsomevalue

popupform.txt2 = mainform.txtsomevalue2


我不能分配硬编码值。



Hmm, where does this With structure go? Also i''m trying to assign the
values of an underlying form to the popup form, so;

popupform.txt1 = mainform.txtsomevalue
popupform.txt2 = mainform.txtsomevalue2

I can''t assign hardcoded values.


这篇关于A2K - 将多个值传递给弹出窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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