R
Rob W
Greetings,
At top of my form/class code I dimension a form object
Dim transferdialog As Form
I then on a button check if the form exists or not using the code below:-
If transferdialog Is Nothing Then
Dim transferdialog As New dlgTransferDetails(txtMemNum.Text.ToString)
transferdialog.Show()
MessageBox.Show(transferdialog.transferLocation)
Else
MsgBox("Already Exists")
transferdialog.Show()
End If
On the dialog form dlgTransferDetails the code on the OK button is as
follows:-
Private Sub cmdOk_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdOk.Click
Me.DialogResult = System.Windows.Forms.DialogResult.OK
cTransferLocation = Me.txtBranch.Text.ToString
Me.Hide()
End Sub
Why does it always think that transferdialog is nothing when a new instance
of dlgTransferDetails has been created?
Thanks
Rob
At top of my form/class code I dimension a form object
Dim transferdialog As Form
I then on a button check if the form exists or not using the code below:-
If transferdialog Is Nothing Then
Dim transferdialog As New dlgTransferDetails(txtMemNum.Text.ToString)
transferdialog.Show()
MessageBox.Show(transferdialog.transferLocation)
Else
MsgBox("Already Exists")
transferdialog.Show()
End If
On the dialog form dlgTransferDetails the code on the OK button is as
follows:-
Private Sub cmdOk_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdOk.Click
Me.DialogResult = System.Windows.Forms.DialogResult.OK
cTransferLocation = Me.txtBranch.Text.ToString
Me.Hide()
End Sub
Why does it always think that transferdialog is nothing when a new instance
of dlgTransferDetails has been created?
Thanks
Rob