By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 2,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

Passing Information to One Form to Another

P: n/a
I am creating a database to track employee time. I have created a
form that allows them to select from a combo box their task, enter
their hours, and add any comments they may have.

In the event "Reporting Request" is selected from the Combo box,
another form pops up IN FRONT of it, allowing for additional
information.

On the Pop-up form, there is an area for "Time" and "Summary"... Is
there anyway to have this information pass to the form behind it?

Time = Time
Comments = Comments

I have read about passing from the original form to the new one, I want
to do the reverse.

Any suggestions would be greatly appreciated!

Thanks!

Brad

Apr 18 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Any form can update a field in any other form that is open, whether
that form is visible or not.

so from form two whereever the form and whenever the form know the
necessary information

forms![Form1Name]![fieldinform1name] = me.fieldname
or
forms![Form1Name]![fieldinform1name] = form![subformname]!fieldname

and go from there

Apr 18 '06 #2

P: n/a
I think it is only work as long as both form open otherwise u have to
assign it to a variable

Apr 18 '06 #3

P: n/a
Cong,
Right..

How do I assign it to a variable?
Cong wrote:
I think it is only work as long as both form open otherwise u have to
assign it to a variable


Apr 18 '06 #4

P: n/a
typically, calling a second form does not necessarily close the calling
form. And I know it can reference hidden forms, because we do that
quite a bit here. If it a question of the Access switchboard, that is a
different issue since most applications do not try to modify the
switchboard.

I just tested the following:
form1 button says open form 2
form2 says on close to update field on form1.
in form 2 on the on close event I wrote:
Forms![Form1]![Text7] = Date

This moved today's date to fhe txtbox "Text7" which is an unbound
tstbox on form 1 but it can be a bound field also.

Everything went fine.

Ron

Apr 18 '06 #5

P: n/a
I tried this and it did not work.

Could you be more specific?

Did you do an expression builder, code builder, etc?

Is the syntax exact?

Apr 26 '06 #6

P: n/a
Drum2001 wrote:
I am creating a database to track employee time. I have created a
form that allows them to select from a combo box their task, enter
their hours, and add any comments they may have.

In the event "Reporting Request" is selected from the Combo box,
another form pops up IN FRONT of it, allowing for additional
information.

On the Pop-up form, there is an area for "Time" and "Summary"... Is
there anyway to have this information pass to the form behind it?

Time = Time
Comments = Comments

I have read about passing from the original form to the new one, I want
to do the reverse.

Any suggestions would be greatly appreciated!

Thanks!

Brad

If FormB is a popup, what you can do is set FormB's visible property to
False when you press the "Exit" button. Code immediately following the
call the open FormB, in FormA, will start executing. You could check to
see if FormB is still open. If so, you can extract the data from FormB
from the code in FormA. Ex:
Docmd.Openform "FormB",,,,,acDialog
'codes waits until user cancels (close form) the action in FormB
'or Exits (makes Visible = False). If not Visible or closed,
'code in FormA continues

If Isloaded("FormB") Then
'process/get data from FormB
Endif
Apr 26 '06 #7

P: n/a
code builder.

in form1 a field called txt1
a button to open form2

In form2 a filed called txt2
in the after update event is have code that says
Forms![form1]![txt1] = me.txt2

works like a charm

Apr 28 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.