Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Move text from one form to another
Message
De
05/01/2005 05:05:22
 
 
À
14/12/2004 01:23:19
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00968227
Message ID:
00974311
Vues:
14
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!!!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform