Please help before i go mad, i need to use the update in the main class to access the list in the footballadmin and then display each in a list box but i cant get it to work.

Imports Football

Public Class FootballAdmin

  Private fTeam As List(Of FootballTeams)

  Public Sub New()
    fTeam = New List(Of FootballTeams)
  End Sub

  Public ReadOnly Property Teams() As List(Of FootballTeams)
    Get
      Return fTeams
   End Get
  End Property
End Class
Public Class MainForm    
  Private fFootballAdmin As FootballAdmin

  Public Sub New()
    InitializeComponent()
    fFootballAdmin = New FootballAdmin
    updateView()
  End Sub

  Private sub updateView()    
    For each team As List(of fFootballAdmin) In fFootballAdmin.Teams()
      teamSheetListBox.Items.Add(team.ToString)
    Next   
  End Sub
End Class

Thanks

Is the first line 13 supposed to be return fTeam (instead of fTeams)?

Also, what error are you getting?

should be fTeam

What behavior is it showing (or error message)?
...or is it fixed?

This method isnt working

Private sub updateView()
For each team As List(of fFootballAdmin) In fFootballAdmin.Teams()
teamSheetListBox.Items.Add(team.ToString)
Next

It looks like it should be

For each team As FootballTeams in fFootballAdmin.Teams()
   ' code goes here
Next

Nope it is saying FootballTeams is not declared

Maybe you should add "Imports Football" to the top of that module.
...unless it's really not defined anywhere.

But is that not the point of

Private fFootballAdmin As FootballAdmin, so it will bring the import in or is that not the case.

That still does not get you the internal definitions.

Thanks

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.