Group,
I'm working to use a second for to do task that will be populate texts boxes in the first form. However I'm getting an error that says, "An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object.
In Form1, where the code starts, the code looks like this:
Public Sub cbxEditLocation_Click(sender As Object, e As System.EventArgs) Handles cbxEditLocation.Click
cbxDeleteLocation.Checked = False
cbxNewEntry.Checked = False
cbxEditLocation.Checked = True
sTask = 1
Popup_LocationEdit.ShowDialog()
End Sub
Form2 never opens, but it looks like this:
Private Sub Popup_LocationEdit_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
If sTask = 1 Then
txbFormType.Text = "Enter the Location to Edit"
End If
If sTask = 2 Then
txbFormType.Text = "Enter the Location to Delete"
End If
End Sub
I've tried using "Popup_LocationEdit.Show()" with the same error message. Can someone tell me what's going on here and how to fix it? I know I've done this before. But I don't recall having this kind of error.
Thanks for your help.
Don