Yes, VB6 has an odd object behavior. This gives you several shortcuts for working with form objects.
Load frmMain
... will load one instance of this form under this variable name. Actually:
frmMain.lblSomeLabel.Caption = "some caption"
... will load this instance. But:
frmMain.SomeStringMember = "some value"
... will not load the form object (which means the window itself), but you can access these variables, so essentially the name of the form is a global variable.
However, you can create new instances:
Dim newForm As MyForm Set newForm = New MyForm newForm.Show vbModal
This will actually create a new instance of MyForm , load it and show it, so you can have multiple instances of the same form.
Also beware of the oddness in the New key:
Dim newObject As New MyClass Set newObject = Nothing newObject.SomeStringProperty = "some value"
This works without the error "Object Reference Not Set ...". When you declare a reference variable using As New syntax, you can destroy the object by setting it to Nothing , and then reference that variable again and create a new instance.
In fact, what really happens with forms. There is an implicit:
Dim frmMain As New frmMain
Personally, I prefer not to use As New syntax because it is confusing and dangerous. It also has a performance penalty, against this:
Dim newObject As MyClass Set newObject = New MyClass
... but you are stuck with it for forms.
What happens when Unload frmMain called Unload frmMain is that it unloads the window (and all controls), so all the data in them has disappeared, but the frmMain object is still hanging around. Therefore, even after unloading it, you can access any member variables and properties. However, if something refers to a control on the form, it invokes the implicit Load frmMain . This is the source of many subtle programming errors in VB6, especially when you are trying to close.