Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return Value from Modal Form
Message
 
To
11/05/2000 11:32:42
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00368596
Message ID:
00368708
Views:
19
>Hi,
> How to pass/return value to/from modal form in VB?
>
>Thank you

There is one way.

On the first form, add a command button and paste this code:
Private Sub Command1_Click()
    MsgBox Form2.DisplayModal("This is a test")
End Sub
On the second form, add a text box and a command button and paste this code:
Private mstrValue As String

Private Sub Command1_Click()
    mstrValue = Text1.Text
    Unload Me
End Sub

Public Function DisplayModal(ByVal pstrParamIn As String) As String
    Text1.Text = pstrParamIn
    Me.Show vbModal
    DisplayModal = mstrValue
End Function
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform