i have a database shown on VB 2008 showing music information. i am trying to show the track with the greatest number of sales however it is only displaying the current information on the screen (i am showing the access database in multiple text boxes) rather than searching the database.
this is the section of code i am struggling with:
i also would like to add to this, i would like the user to be able to select a year from a list box to show the track with the greatest number of sales in that year. any ideas would be great.Code:Private Sub Btntopseller_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btntopseller.Click Dim index, largest As Integer Dim found As Boolean Dim topselling As String largest = CInt(mytable.Rows(row)(3)) found = False index = 0 topselling = mytable.Rows(row)(1) While (found = 0) And (index < largest) If CStr(mytable.Rows(row)(3)) = largest Then found = True MessageBox.Show("Tune Found") TextBox1.Text = topselling Else index = index + 1 End If End While End Sub End Class
thankyou
andy




Reply With Quote