从一种形式传递到另一种形式 [英] passing from one form to the next

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

问题描述

我觉得这个问题真的很愚蠢,但我不知道为什么它不起作用。


我有一个有文本字段的表单。您在文本字段中键入一个数字,它与一个字符串连接,然后在字段Survey_Num中作为字符串放入表中。


按下一个按钮表格和另一个表格弹出。有一个Survey_Num,这个表格背后的表格中的字段也是一对多的关系。


我希望第一个表单上的值显示在该字段中第二种形式。


我猜它没有出现,因为从技术上来说,价值还没有从第一种形式进入表格。


当我按下按钮转到第二个表单时,如何强制Access输入数据?当第二个表格打开时,我已经尝试使用关闭命令来关闭第一个表单,认为这会将信息输入到表中但没有骰子。


看起来很简单但是我我很难过 - 任何想法?


我能提供的任何代码吗?

表格1 =带有未绑定字段txt_SurveyNum的frm_Survey,其中用户输入一个整数绑定到Survey表的Survey_Num的不可见字段txt_SurveyNumID。


txt_SurveyNum具有LostFocus事件:

展开 | 选择 | 换行 | 行号

解决方案

嗯,这可能是因为该字段是不可见的。我不确定,因为我没有测试过这个但是在你在Lost Focus事件中分配值之前,试着让它可见,分配值,然后让它再次隐形。


我尝试了所有可见的字段,但它没有显示在第二个表单上。


你是否试图将连接的字符串传递给另一个表单?

I feel really dumb asking this but I''m not sure why it isn''t working.

I have a form that has a text field. You type a number into the text field, it gets concatenated with a string, then gets put into the table as a string in the field "Survey_Num".

Press a button on the form and another form pops up. There is a "Survey_Num" field in the table behind this form as well and they are tied in a one-to-many relationship.

I want the value on the first form to show up in the field on the 2nd form.

I am guessing that it is not showing up because technically the value hasn''t entered the table from the first form.

How do I force Access to enter the data when I press the button to go to the second form? I''ve tried using a close command to close the first form when the 2nd form is opening, thinking that will enter the info into the table but no dice.

Seems simple but I am stumped - any ideas?

Any code I can provide?

Form 1 = frm_Survey with unbound field txt_SurveyNum where user enters an integer and invisible field txt_SurveyNumID that is bound to Survey_Num of Survey table.

txt_SurveyNum has LostFocus event:

Expand|Select|Wrap|Line Numbers

解决方案

Hmm, it might be because the field is invisible. I''m not sure as I haven''t tested this but before you assign the value in the Lost Focus event, try making it visible, assign the value, and then make it invisible again.


I tried everything with the field visible but it doesn''t show up on the 2nd form.


Are you trying to pass the concatenated string to yet another form?


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

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