I am getting this error after I have packaged and deployed my application. What is funny is that it runs fine within VB and as an executable but after I package and deploy it, I get this error when I try to view another form.
When the program opens, I click a button:
Private Sub cmdViewFamilyTree_Click()
Dim frm As New frmFamilyTree
If mlngPersonID = 0 Then
MsgBox "Please select a person from the list", vbInformation
ElseIf txtFamilyNumber.Text = "1" Then
MsgBox "No information available on father", vbInformation
'Exit Sub
ElseIf txtFather.Text = "" Then
MsgBox "No information available on father", vbInformation
'Exit Sub
Else
frm.Show
Unload Me
End If
End Sub
Loading the FamilyTree form:
Private Sub Form_Load()
Set mobjPerson = New CPerson
Set mobjSpouseParents = New CSpouseParents
Set mobjParents = New CParents
Set mobjChild = New CChild
Set mobjSpouse = New CSpouse
'Insert tree picture from frmPictures
imgImage.Picture = frmPictures.imgTree.Picture
imgImage1.Picture = frmPictures.imgTree.Picture
'display selected person's name
If frmMain.txtMiddleName.Text = "" Then
lblName.Caption = frmMain.txtFirstName.Text & " " & frmMain.txtLastName.Text
Else
lblName.Caption = frmMain.txtFirstName.Text & " " & frmMain.txtMiddleName.Text & " " & frmMain.txtLastName.Text
End If
mlngPersonID = frmMain.txtPersonID.Text
DisplayFamily
End Sub
When the program opens, I click a button:
Private Sub cmdViewFamilyTree_Click()
Dim frm As New frmFamilyTree
If mlngPersonID = 0 Then
MsgBox "Please select a person from the list", vbInformation
ElseIf txtFamilyNumber.Text = "1" Then
MsgBox "No information available on father", vbInformation
'Exit Sub
ElseIf txtFather.Text = "" Then
MsgBox "No information available on father", vbInformation
'Exit Sub
Else
frm.Show
Unload Me
End If
End Sub
Loading the FamilyTree form:
Private Sub Form_Load()
Set mobjPerson = New CPerson
Set mobjSpouseParents = New CSpouseParents
Set mobjParents = New CParents
Set mobjChild = New CChild
Set mobjSpouse = New CSpouse
'Insert tree picture from frmPictures
imgImage.Picture = frmPictures.imgTree.Picture
imgImage1.Picture = frmPictures.imgTree.Picture
'display selected person's name
If frmMain.txtMiddleName.Text = "" Then
lblName.Caption = frmMain.txtFirstName.Text & " " & frmMain.txtLastName.Text
Else
lblName.Caption = frmMain.txtFirstName.Text & " " & frmMain.txtMiddleName.Text & " " & frmMain.txtLastName.Text
End If
mlngPersonID = frmMain.txtPersonID.Text
DisplayFamily
End Sub