473,395 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Passing data between forms...

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 ??
Nov 20 '05 #1
2 981

Ok just to narrow it down a bit for you guy's I dumped
the event procedure onto the second form and performed
the search on the arraylist that way and it does produce
the desired results, so my classes must be set properly
with correct names etc. So there definetly seems to be a
problem with passing it between the forms...
Nov 20 '05 #2
Finally figured this one out myself the value was
definetly getting lost between the forms, so what I done
was simply passed the value to the form through a
variable and performed the search on the arraylist
automatically in the form B's load event if a specific
criteria was met - easy when you know how, highly
distressing when you don't

Muuuuhaaaahaaaa.....!
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Alex Vinokur | last post by:
Various forms of argument passing ================================= C/C++ Performance Tests ======================= Using C/C++ Program Perfometer...
12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
2
by: Richard | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** HI, I am working on a project where I need to input data to a (local) HTML page using multiple form elements, such as text,...
11
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
8
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
6
by: Scott Zabolotzky | last post by:
I'm trying to pass a custom object back and forth between forms. This custom object is pulled into the app using an external reference to an assembly DLL that was given to me by a co-worker. A...
5
by: Rod | last post by:
I've written 2 ASP.NET applications (I've worked on one with a team and another by myself). In my ASP.NET pages, when saving data to a backend database I've done it by using the click event of a...
0
by: Eric Sabine | last post by:
OK, I'm trying to further my understanding of threading. The code below I wrote as kind of a primer to myself and maybe a template that I could use in the future. What I tried to do was pass data...
2
by: Carl Heller | last post by:
Working in VS2003, .Net 1.1 I'm working on a project where I compare data between two databases. This is a lengthy process, and very data intensive, so I decided to create a class, and thread...
1
by: SteveDouglas | last post by:
Hi all, I am currently writing an application in VB.NET that has a lot of controls (treeviews/listviews/labels and so forth) that represent "things" that need to be draggable from place to place,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.