Hi All,

I'm very new to VB, and I've been working a project for a class for a while. I'm trying to link totals from three different forms to a final form, but I'm getting stuck w/my coding. Someone suggested that I use the first form to set up the all the info that would need to pass through but for some reason, I keep getting errors. The primary error I'm getting says that a 'parent' is not a memeber of the form and an event load can not be found. Actually I have a total of 5 errors, which I'm going to list and I'm also going to attach my project in case that makes it any clearer. Thanks very much for help in advance.
Thanks again,

Tina

Error list:

Error #1 Event 'Load' cannot be found. associated with:
Private Sub DirectoryForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub

Error #2 Error 2 Handles clause requires a WithEvents variable defined in the containing type or one of its base types. associated w/:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

MembershipOptionsForm.Show(Me)
End Sub
End Class

Error # 3 Error 3 Option Strict On disallows implicit conversions from 'Hayes_Fitness_Center.DirectoryForm.DirectoryForm' to 'System.Windows.Forms.IWin32Window'.
associated w/:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

MembershipOptionsForm.Show(Me)
End Sub
End Class

Error # 4 Error 4 'Parent' is not a member of 'Hayes_Fitness_Center.DirectoryForm.MemberhshipOptionsForm'. C:\Users\Tina\Desktop\Hayes Fitness Center\Hayes Fitness Center Solution\Hayes Fitness Center\Form1.vb 71 15 Hayes Fitness Center
associated w/:
Public Class MemberhshipOptionsForm


Public Sub DataChanged(ByVal sender As Object, ByVal e As EventArgs)

CType(Me.Parent, DirectoryForm).MyMember.MembershipOption =
End Sub

End Class

Error #5 Error 5 Expression expected. C:\Users\Tina\Desktop\Hayes Fitness Center\Hayes Fitness Center Solution\Hayes Fitness Center\Form1.vb 71 67 Hayes Fitness Center
associated w/:
CType(Me.Parent, DirectoryForm).MyMember.MembershipOption =
End Sub

Please supply some of your codes so that we can determine which line gives an error. thanks

I'm posting both the error messages & the coding for my first form (also in the original post I've attached my project just in case it is easier to see in the VB format). Thanks very much for looking at my post & for your help.

Error 1 Event 'Load' cannot be found.
Error 2 Handles clause requires a WithEvents variable defined in the containing type or one of its base types.

Error 3 Option Strict On disallows implicit conversions from 'Hayes_Fitness_Center.DirectoryForm.DirectoryForm' to 'System.Windows.Forms.IWin32Window'.

Error 4 'Parent' is not a member of 'Hayes_Fitness_Center.DirectoryForm.MemberhshipOptionsForm'.

Error 5 Expression expected.

My form code:
Public Class DirectoryForm

Public Class Member

Private _MemberID As Integer
Public Property MembershipID() As Integer
Get
Return _MemberID
End Get
Set(ByVal value As Integer)
_MemberID = value
End Set
End Property


Private _MembershipOption As String
Public Property MembershipOption() As String
Get
Return _MembershipOption
End Get
Set(ByVal value As String)
_MembershipOption = value
End Set
End Property

'etc add other values you need including calculations

End Class

Public Class DirectoryForm

Private _MyMember As Member

Public Property MyMember() As Member
Get
If Me._MyMember Is Nothing Then
Me._MyMember = New Member
End If
Return Me._MyMember
End Get
Set(ByVal value As Member)
Me._MyMember = value
End Set
End Property


Private Sub DirectoryForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

MembershipOptionsForm.Show(Me)
End Sub
End Class

Public Class MemberhshipOptionsForm


Public Sub DataChanged(ByVal sender As Object, ByVal e As EventArgs)

CType(Me.Parent, DirectoryForm).MyMember.MembershipOption =
End Sub

End Class


Private Sub ExitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ExitButton.Click
Me.Close()

End Sub

Private Sub MembershipButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MembershipButton.Click
MembershipOptionsForm.Show()
End Sub

Private Sub EquipmentButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles EquipmentButton.Click
EquipmentChoicesForm.Show()
End Sub

Private Sub ClothingButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ClothingButton.Click
ClothingForm.Show()

End Sub

End Class

i run your project and it works fine no errors on loading.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.