Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to call a form and pass it parameters
Message
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00569379
Message ID:
00569688
Views:
26
This code could be used to pass nearly anything. Another alternative would be as Eric has recomended in the past to create a function that accepts a parameter. I like the property method because I can use the info when I am ready.

' ** Module code to emulate your calling procedure
Sub main()
    Form1.pParam = "Hello Form."
    Form1.Show
End Sub

'  ** Form code to accept parameters
Private m_varpParam As Variant 

Public Property Get pParam() As Variant
    pParam = m_varpParam
  End Property
  Public Property Let pParam(ByVal varpParam As Variant)
    m_varpParam = varpParam
End Property

' Example to show param came through.
Private Sub Form_Load()
    Me.Caption = m_varpParam
End Sub
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Previous
Reply
Map
View

Click here to load this message in the networking platform