Passing variables between forms?

T

Tails

I'm new-ish to access and I am trying to take input on one form, and pass it
to another.

I tried to declare a Public variable in general declaractions but it doesn't
seem to be working - the variable is always empty when the second form
loads?

Is there another way please?

Thanks.
 
M

Mike Painter

Tails said:
I'm new-ish to access and I am trying to take input on one form, and
pass it to another.

I tried to declare a Public variable in general declaractions but it
doesn't seem to be working - the variable is always empty when the
second form loads?

Is there another way please?

If the input is into a bound form then there is no need for variables but
you might have to requery the recordsource.
If the information is unbound then you will have to use code to place the
information into the variable
MyVariable = Me!SomeField and more code to place it in the other unbound
field, probably the OnCurrent event.
You could also pass it to the form with the Args portion of OpenForm.
 
T

Tails

Mike Painter said:
If the input is into a bound form then there is no need for variables but
you might have to requery the recordsource.
If the information is unbound then you will have to use code to place the
information into the variable
MyVariable = Me!SomeField and more code to place it in the other unbound
field, probably the OnCurrent event.
You could also pass it to the form with the Args portion of OpenForm.

Thank you to you, and also to Ken. It was an unbound control, so passing it
the way you described seemed like the best way.

It works now anyway, so thanks for taking the time to help a newbie!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top