Solved

passing a value from one form to another

Posted on 1998-10-26
2
144 Views
Last Modified: 2010-04-30
I am building an application where, when a search button is clicked from any form, we get to a search form.  From here, I want to be able to pass the result to the original form where all the relevant fields for that record would get filled in text boxes.  How can I get back to the original form and how do I pass the value from Search form to original form.
0
Comment
Question by:bhavan
2 Comments
 
LVL 12

Accepted Solution

by:
jgv earned 100 total points
ID: 1441708
Add a Module to your project....select 'Project' - 'Add Module'. Declare any variables which should be visible to all forms within the module using the 'Global' declaration.

Global str as string
Global num as iteger
etc...

Use the hide/show to switch between forms.
Form1.hide          Form1.show

Declare a global variable that will indicate which form the search came from. Form1=1, Form2=2, Form3=3, etc. Make sure you udate the variable before proceeding to the 'search form'.
0
 
LVL 1

Expert Comment

by:wford
ID: 1441709
or better, if you set a type or an array in the search form as
public Results(0 to 4) as string

in your seach forma declare area, then you could referance these any where  (as long as your seach form is still loaded) by for example:

For n = 0 to 4
   text1(n) = frm_Search.Results(n)
next n
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now