|
-
May 28th, 2002, 09:22 PM
#1
How do I pass values between forms?
For example:
I have a form A, which displays Customer data including Company name. User enters Company and on Lost Focus event I display form B, which shows the Datagrid with all customers for this company.
So, how do I pass the value of txtCompany.text from form A to form B as a parameter that I can include in SELECT statement.
I appreciate any suggestions.
-
May 28th, 2002, 09:30 PM
#2
PowerPoster
Why are you doing it on Lost Focus?
-
May 28th, 2002, 09:39 PM
#3
Well, I thought, after user types company name, the next thing to tab. What are the other options: command buttom? And it is not critical right now. I don't know how to tie two forms together by value. Please advice me on that.
Thanks.
-
May 28th, 2002, 10:17 PM
#4
Hyperactive Member
The easiest way to pass the value is to set up a Public variable in form B for this.
In Form B declarations:
Public strCompany as String
Private sub Form_Load()
(your SQL statment would be here to load the grid using strCompany)
end sub
Then, however you decide to send the value, just set it like this in form A:
Code:
With FormB
.strCompany = FormA.txtCompany.Text
.Show
end with
-
May 28th, 2002, 10:39 PM
#5
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|