That's clumsy: and probably not going to work too well as you almost certainly need to create a new instance of the form in order to display it anyway.
The first improvement is to use
switch
instead of
if
:
Dim f As Form = Nothing
Select Case ComboBox1.Text
Case "1"
f = New Form1()
Case "2"
f = New Form2()
Case Else
MessageBox.Show("Please select a number")
Return
End Select
f.Show()
Me.Close()
But ... be aware that if this is on your main form, then the
Close
call at the end will immediately terminate the application and close all forms.