将值从一种形式匹配到另一种形式 [英] Matching a value from one form to another

查看:67
本文介绍了将值从一种形式匹配到另一种形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

以下是我要做的事情:

表格A&表格B

表格A:

compressor_id = 23

描述:test


表格B:

stage_id = 12

compressor_fk = compressor_id

描述:test2


我创建一个按钮表格A所以当我点击它时,它将带我到表格

B.我有关系b / w我的表格,其中COMPRESSOR(名字

表格)compressor_id = STAGES表中的compress_fk。那是

工作正常。现在我想要的是:当我点击表格B上的

我的按钮时,它会自动将我的compress_id显示到

compressor_fk中。现在,我可以将compress_id键入我的表格B

,它会识别它没有任何问题。我通过转到

表进行测试,我可以看到值匹配(compress_id和

compressor_fk)。

摘要:我想要它在我的

表格B中自动显示compress_id,我不想输入它。


请帮助,谢谢

解决方案

" erick-flores" < ch ********** @ hotmail.comwrote in

新闻:11 ********************* *@h48g2000cwc.googlegr oups.com:


大家好,

以下是我要做的事情:

表格A&表格B

表格A:

compressor_id = 23

描述:test


表格B:

stage_id = 12

compressor_fk = compressor_id

描述:test2


我创建一个按钮表格A所以当我点击它时,它将带我

到表格B.我有关系b / w我的表格,其中

COMPRESSOR(表名)compress_id = compress_fk在

的STAGES表中。这工作正常。现在我想要的是:

当我点击将我带到表格B的按钮时,它将自动将我的compress_id显示在compress_fk中。

现在,我可以在我的表格B中输入compress_id,它可以识别它没有任何问题。我通过转到

表进行测试,我可以看到值匹配(compress_id

和compress_fk)。

摘要:我想要它在我的表格B中自动显示compress_id

,我不想输入它。


请帮助,谢谢


在表单A上的OnClick事件中,您需要添加一个命令

将表单A上的控件值复制到等效值

在打开表格B的命令之后控制表格B.


表格!form_B!compressor_fk = me.compressor_id

-

Bob Quintal


PA是我改变了我的电子邮件地址。


-

通过 http://www.teranews.com 上的免费Usenet帐户发布


感谢您的回答


我做了你告诉我的事,但收到了一条错误信息:

Private Sub Command22_Click()

On Error GoTo Err_Command22_Click


Dim stDocName As String

Dim stLinkCriteria As String


stDocName =" STAGES"

DoCmd.OpenForm stDocName'',,, stLinkCriteria

形式!阶段!comp_fk = Me.comp_pk


Exit_Command22_Click:

退出Sub


Err_Command22_Click:

MsgBox Err.Description

恢复退出_Command22_Click


结束子


行表格!阶段!comp_fk =我.comp_pk"

----!Stages< ----它高亮一点,然后说:

编译错误:

资格赛必须是收藏


阶段是我的表格B的名称


有什么建议吗?如果你能提供帮助,我会为此疯狂

真的是aprecciate


谢谢

我也在尝试:


Private Sub Command22_Click()

On Error GoTo Err_Command22_Click


Dim stDocName As String

Dim stLinkCriteria As String


stDocName =" STAGES"


stLinkCriteria =" [comp_fk] =" &安培;我![comp_pk]

DoCmd.OpenForm stDocName ,,, stLinkCriteria

Exit_Command22_Click:

退出子


Err_Command22_Click:

MsgBox Err.Description

恢复退出_Command22_Click


结束子


这样工作正常,它只是不会显示表格A中的值到表格B的价值。是否可以选择将表格A中的值显示为

表格B?因为[comp_fk] = &安培;我![comp_pk]它的工作但不是显示价值的
。我希望从表格A到表格B显示我的价值。


请帮助:''(


Hello all,
Here is what i am trying to do doing:
Form A & Form B
Form A:
compressor_id = 23
Description: test

Form B:
stage_id = 12
compressor_fk = compressor_id
Description: test2

I create a button in Form A so when I click it it will take me to Form
B. I have the relationship b/w my tables, where COMPRESSOR (name of
table) compressor_id = compressor_fk in the STAGES table. That is
working fine. Now what I want is: when I click on the button that takes
me to Form B, it will automatically display my compressor_id into the
compressor_fk. Right now, I can type the compressor_id into my Form B
and it will recognize it w/o any problem. I tested by going to the
tables and I can see the values are matching (compressor_id and
compressor_fk).
Summary: I want it to automatically display the compressor_id in my
Form B, I do not want to type it.

Please help, thank you

解决方案

"erick-flores" <ch**********@hotmail.comwrote in
news:11**********************@h48g2000cwc.googlegr oups.com:

Hello all,
Here is what i am trying to do doing:
Form A & Form B
Form A:
compressor_id = 23
Description: test

Form B:
stage_id = 12
compressor_fk = compressor_id
Description: test2

I create a button in Form A so when I click it it will take me
to Form B. I have the relationship b/w my tables, where
COMPRESSOR (name of table) compressor_id = compressor_fk in
the STAGES table. That is working fine. Now what I want is:
when I click on the button that takes me to Form B, it will
automatically display my compressor_id into the compressor_fk.
Right now, I can type the compressor_id into my Form B and it
will recognize it w/o any problem. I tested by going to the
tables and I can see the values are matching (compressor_id
and compressor_fk).
Summary: I want it to automatically display the compressor_id
in my Form B, I do not want to type it.

Please help, thank you

In the OnClick Event on form A you need to add a command which
copies the value of the control on form A to the equivalent
Control on form B, after the command that opens form B.

Forms!form_B!compressor_fk = me.compressor_id
--
Bob Quintal

PA is y I''ve altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com


Thank for your answer

I did what you told me but I am getting an error message:

Private Sub Command22_Click()
On Error GoTo Err_Command22_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "STAGES"
DoCmd.OpenForm stDocName '', , , stLinkCriteria
forms!Stages!comp_fk = Me.comp_pk

Exit_Command22_Click:
Exit Sub

Err_Command22_Click:
MsgBox Err.Description
Resume Exit_Command22_Click

End Sub

The line "forms!Stages!comp_fk = Me.comp_pk"
----!Stages <---- it higlight this, and says:
Compile error:
Qualifier must be collection

Stages is the name of my Form B

Any suggestions? I am going crazy with this if you can help I will
really aprecciate

Thanks


I am also trying:

Private Sub Command22_Click()
On Error GoTo Err_Command22_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "STAGES"

stLinkCriteria = "[comp_fk]=" & Me![comp_pk]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command22_Click:
Exit Sub

Err_Command22_Click:
MsgBox Err.Description
Resume Exit_Command22_Click

End Sub

This is working fine, it just wont display the value from the Form A to
the Form B. Is there an option to display the value from the Form A to
Form B? because the "[comp_fk]=" & Me![comp_pk] its working but its not
displaying the value. I wanna see my value displayed from form A to
form B.

Please helppp :''(


这篇关于将值从一种形式匹配到另一种形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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