Using a var in the name of a new form..
When using Dim whatever as New Form1 is there any way to use a variable instead of 'whatever'.
An example would be "duplicating" Form1 with names like newfrm1, newfrm2, etc.
How would I do this? Im sure its really easy but as always I cant figure it out :D.
Another problem! (last one I hope!)
Here is the entire function:
VB Code:
Public Function DoMsg(SenderNick, Msg)
Dim MsgWindow() As frmMsg, i, User(), x
i = UBound(MsgWindow) + 1 'Subscript Out Of Range?!
ReDim Preserve MsgWindow(i)
Set MsgWindow(i) = New frmMsg
For x = 0 To UBound(MsgWindow) 'Object Variable or with block not set?!
If MsgWindow(x).Caption = SenderNick Then
MsgWindow(x).txtRecieve.text = MsgWindow(x).txtRecieve.text & vbCrLf & "< & sendernick & " > " & msg"
Exit Function
Else
MsgWindow(x).Show
MsgWindow(x).Caption = SenderNick
MsgWindow(x).txtRecieve.text = MsgWindow(i).txtRecieve.text & vbCrLf & "<" & SenderNick & " > " & Msg
Exit Function
End If
Next x
End Function
The idea is that if a form is open with the caption the same as the SenderNick it will just add the text to that form. It doesnt even get that far...
Once again, thanks for all your help everyone. I really appreciate it!