'This Function fills the ListBoxes (ListTeam1 etc) that call it in the "row source type".
'It fills it with the Kids names & their team based on the function
Function FillListTeamX(fld As Control, id As Variant, _
row As Variant, col As Variant, code As Variant) _
As Variant
On Error GoTo Err_FillListTeamX
Dim intOffset As Integer
Dim GroupChosen As Integer
Static Kids As Variant, Entries As Integer, ListNum As Integer
Select Case code
Case acLBInitialize [COLOR=red] ' Initialize.[/color]
Kids = WhereAreThey() [COLOR=red]'fills array-WORKS![/color]
Entries = Kids(0, 0)
[COLOR=green] This is where I want to add a statement/s that will get the name of the listbox that is calling this function to be used in the IF/THEN statement in the "Case acLBGetValue" section. [/color]
FillListTeamX = True
Case acLBOpen [COLOR=red] ' Open.[/color]
FillListTeamX = Timer [COLOR=red] ' Unique ID. [/color]
Case acLBGetRowCount [COLOR=red] ' Get rows.
FillListTeamX = Entries
Case acLBGetColumnCount [COLOR=red] ' Get columns.[/color]
FillListTeamX = 1
Case acLBGetColumnWidth [COLOR=red]' Get column width.[/color]
FillListTeamX = -1 [COLOR=red] ' Use default width.[/color]
Case acLBGetValue [COLOR=red] ' Get the data.[/color]
If ListNum = Kids((row + 1), 1) Then
FillListTeamX = Kids((row + 1), 1)
End If
End Select
Exit Function
Err_FillListTeamX:
MsgBox Err.Description
End Function