There are several ways to do it...public variable in a module, public sub in the main form, or a public property. Personally, I use properties now for this kind of thing. Here's an example:
In the main IRC form:
vb Code:
'General declarations section, below Option Explicit somewhere...
Private p_Channel As String
'With your other procedures.
Public Property Get Channel() As String
Channel = p_Channel
End Property
Public Property Let Channel(ByRef NewValue As String)
p_Channel = NewValue
'Channel has changed, join?
If Len(NewValue) > 0 Then
'Code to join new channel
End If
End Property
Then in the form that pops up and asks for a channel name, in the command button you can put:
vb Code:
Private Sub cmdJoin_Click()
'Main IRC form Name of channel box
frmIRC.Channel = txtChannel.Text
Unload Me
End Sub
I think this way is easier and cleaner than a public sub or variable somewhere.