Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Move text from one form to another
Message
From
05/01/2005 05:05:22
 
 
To
14/12/2004 01:23:19
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00968227
Message ID:
00974311
Views:
15
Ra Fe,

Hi! Just saw your post. It seems like you want to return a value from one form to another. Instead of MainForm.Text1=SubForm.Text2 you could also write your code to call the SubForm as a function like:

MainForm.Text1=SubForm.GetValue()

Where GetValue would be a public function in SubForm which would look something like:

Public Function GetValue() as Integer (or what ever data type you want)
SubForm.Show vbModal
GetValue = RetVal
End Function

As soon as this function is called it launches your SubForm as modal. Before you close your form, you must transfer the value entered in Text2 into a variable (RetVal) which you have to declare at the top of your code in the General Section.

When SubForm closes the value in RetVal is returned to the calling program where you can do with it as you wish as in...

if MainForm.Text1 = 0 Then...

Hope this does the trick 8 )



Happy New Year!!!

Martin
Shit happens!!!
Previous
Reply
Map
View

Click here to load this message in the networking platform