?
Solved

passing a value from one form to another

Posted on 1998-10-26
2
Medium Priority
?
149 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
jgv earned 200 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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
Course of the Month13 days, 15 hours left to enroll

801 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