S
Steven Smith
Help I've got a problem !
What I'm trying to do is in one event procedure in Form A
is to search an array list class for a match on one
element and display the results on Form B
I've got a similar but slightly more complex function
working perfectly inside Form A which goes something like
this:
\\\>
Private Sub cmdSearch_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) _
Handles cmdSearch.Click
Dim tempAlbum As New Album_Class
Select Case True
Case Me.cmbSearchOn.SelectedItem = "Genre"
For Each tempAlbum In myMusic
If tempAlbum.Genre =
Me.txtSearchCriteria.Text Then
Call display(tempAlbum)
End If
Next tempAlbum
end sub
Private Sub display(ByRef tempAlbum)
cmbGenre.SelectedItem = tempAlbum.Genre
txtAlbumName.Text = tempAlbum.AlbumName
txtArtistName.Text = tempAlbum.ArtistName
txtRecordLabel.Text = tempAlbum.RecordLabel
txtYear.Text = tempAlbum.Year
end sub
///>
^^^This simply searches the arraylist and display the
result as you would expect. However this one which is
trying to work between the 2 forms refuses to display any
results
\\\>
Private Sub txtArtistName_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) _
Handles txtArtistName.DoubleClick
Dim tempArtist As New Artist_Class
For Each tempArtist In myArtists
If tempArtist.ArtistName =
Me.txtArtistName.Text Then
Call display_artist(tempArtist)
End If
Next tempArtist
objArtistForm.ShowDialog()
End Sub
Private Sub display_artist(ByRef tempArtist)
objArtistForm.txtSingerName.Text =
tempArtist.ArtistName
objArtistForm.txtDateOfBirth.Text =
tempArtist.DateOfBirth
objArtistForm.txtDateOfDeath.Text =
tempArtist.DateOfDeath
objArtistForm.txtBiography.Text =
tempArtist.Biography
End Sub
///>
Can anyone see anything blatantly obvious that I might be
doing wrong ??
What I'm trying to do is in one event procedure in Form A
is to search an array list class for a match on one
element and display the results on Form B
I've got a similar but slightly more complex function
working perfectly inside Form A which goes something like
this:
\\\>
Private Sub cmdSearch_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) _
Handles cmdSearch.Click
Dim tempAlbum As New Album_Class
Select Case True
Case Me.cmbSearchOn.SelectedItem = "Genre"
For Each tempAlbum In myMusic
If tempAlbum.Genre =
Me.txtSearchCriteria.Text Then
Call display(tempAlbum)
End If
Next tempAlbum
end sub
Private Sub display(ByRef tempAlbum)
cmbGenre.SelectedItem = tempAlbum.Genre
txtAlbumName.Text = tempAlbum.AlbumName
txtArtistName.Text = tempAlbum.ArtistName
txtRecordLabel.Text = tempAlbum.RecordLabel
txtYear.Text = tempAlbum.Year
end sub
///>
^^^This simply searches the arraylist and display the
result as you would expect. However this one which is
trying to work between the 2 forms refuses to display any
results
\\\>
Private Sub txtArtistName_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) _
Handles txtArtistName.DoubleClick
Dim tempArtist As New Artist_Class
For Each tempArtist In myArtists
If tempArtist.ArtistName =
Me.txtArtistName.Text Then
Call display_artist(tempArtist)
End If
Next tempArtist
objArtistForm.ShowDialog()
End Sub
Private Sub display_artist(ByRef tempArtist)
objArtistForm.txtSingerName.Text =
tempArtist.ArtistName
objArtistForm.txtDateOfBirth.Text =
tempArtist.DateOfBirth
objArtistForm.txtDateOfDeath.Text =
tempArtist.DateOfDeath
objArtistForm.txtBiography.Text =
tempArtist.Biography
End Sub
///>
Can anyone see anything blatantly obvious that I might be
doing wrong ??