Form Navigation

J

JMorrell

I have a form where a user clicks a button. Based on various settings, the
user may be directed to a msgbox with a vbyesno option. If they choose "yes"
I have another form open up for them to enter information into 2 unbound
controls and "Submit" this information. I want to come back to the vb code
that called form #2 and use the user's input fields for more work.

Where to start?

tia,
 
A

Andi Mayer

I have a form where a user clicks a button. Based on various settings, the
user may be directed to a msgbox with a vbyesno option. If they choose "yes"
I have another form open up for them to enter information into 2 unbound
controls and "Submit" this information. I want to come back to the vb code
that called form #2 and use the user's input fields for more work.

Where to start?

Docmd.openForm "Form2", , , , ,acDialog

The sixt option is the key, Form2 gets open and you have to close it
before the code goes further.

If you expect an answer to a personal mail, add the word "manfred" to the first 10 lines in the message
MW
 
J

JMorrell

Thanks so much for the quick reply.

Right. I have it so that the form opens in dialog mode, but how do I get
back to the calling form's vb with the information the user submits there?

<confused>
JMorrell
 
R

Rick Brandt

JMorrell said:
Thanks so much for the quick reply.

Right. I have it so that the form opens in dialog mode, but how do I get
back to the calling form's vb with the information the user submits
there?

The calling code will also continue if you merely hide the called form
instead of closing it. So have the button that currently closes it just
hide it...

Me.Visible = False

....Then you calling code can pull the values from the form and then close
it.
 
A

Andi Mayer

there?

The calling code will also continue if you merely hide the called form
instead of closing it. So have the button that currently closes it just
hide it...

Me.Visible = False

...Then you calling code can pull the values from the form and then close
it.

I use a different way, because I don't like open Form hided and
forgotten. If you open it again (with an openarg) the old Data is
still there.
I write with the on-close event the data either in a Variable or
direct into the Form1

If you expect an answer to a personal mail, add the word "manfred" to the first 10 lines in the message
MW
 
J

JMorrell

This works just as I wanted it to. Thank you. (It's what I asked for, now I
just hope it's what I wanted.)

I delete the control's values and close the form after I use the passed back
info.

Thanks again.
JMorrell
 
Top