Call variable from one form to another

I'm working an application that is now requiring a little VBA.  I've been away from it too long to remember the details.  I need to use a variable created in one form (through the use of a command button) and recall the same variable in another form that will then insert it into a table.  I've included a snippet.  Very simple at this stage but I'm facin a brain freeze.
KDWWAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lluddenCommented:
You can stick the variable in a module, then it will be globally visible within the application.

You can also define it as a global within a form and then access it from other forms.

There are a few other ways too, but those are the easiest.
0
Rey Obrero (Capricorn1)Commented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
KDWWAuthor Commented:
Interesting!  I'll need to experiment but looks promising.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

IrogSintaCommented:
I've included a snippet.
What snippet?
:-)
0
hnasrCommented:
"form that will then insert it into a table"
If interested in the value to insert in a table, then you can pass it as OpenArgs in the OpenForm.

DoCmd.OpenForm "otherForm", acNormal, , , , , "1234"

You can use the value in otherForm:
tableValue = Me.OpenArgs
0
KDWWAuthor Commented:
Just what I needed!  Thank you capricorn1!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.