Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Options for passing values between forms...

Posted on 2003-03-27
Medium Priority
Last Modified: 2010-05-01
I'm a VB Noob and have just started my first program with VB.  What are the options available for passing a value from one form to another?  Also, if anyone can direct me to a good reference and/or tutorial site, I can probably answer alot of my own questions there.  

Question by:jeremycase
  • 3
  • 2
LVL 14

Expert Comment

ID: 8219859
For example

Form2 you have :

Public MyString as string

you can access the value from form1 by typing

msgbox form2.MyString

ps. For tutorials type 'Visual Basic Tutorials' in www.google.com ( It will give many results )

Accepted Solution

Jacamar earned 60 total points
ID: 8220276
Add a new module to your program.  In that module, do

Public stString as String

You can now use stString in any forms in that project.

Author Comment

ID: 8220333
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Expert Comment

ID: 8220376
Funny that it was a B grade............did it do what you wanted?

Author Comment

ID: 8225366
yes it did...I'm sorry...Was my first time...forgive the virgin?

Expert Comment

ID: 8225819
yeah.....I forgive.....it's just that usually if the code does what you were after then and A grade would be assigned.  If the code led you towards getting the answer (like if the code wasn't perfect but it aided you towards the answer) then usually a B, and if the code wasn't very good at all, but it did contain something that opened you up to trying something else that led you to the answer, then a C would be good.

No worries though.  

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question