I have a movie database program that I would like for my movies to be sorted by there genre, I can get it to work partially but it still doesn't sort all of them out correctly.
anyway, I have 2 tables in my database the genre table witch lists the genres on the treeview like
Action
Adventure
Ect...
Ect...
and the movies table witch has the movies names genre and so on, my problem is that in my movies table the genre is stored like so (Action§Adventure§Comedy§) and I can't figure out how to make my code read them and sort them correctly
heres is my code that I have tried but doesn't work correctly
also my code is in a module if that helps any
VB Code:
  1. Case "Genre"
  2.             rsGenre.MoveFirst
  3.             Do While Not rsGenre.EOF
  4.                 nodeX2.Text = Split(nodeX2.Text, "§")
  5.                 Set nodeX2 = treView.Nodes.Add("Collection", tvwChild, rsGenre.Fields("Genre"), rsGenre.Fields("Genre"), "Closed")
  6.                 nodeX2.Tag = "G|" & rsGenre.Fields("Genre")
  7.                 rsGenre.MoveNext
  8.                Loop
  9.             rsMovies.MoveFirst
  10.             Do While Not rsMovies.EOF
  11.                 strTemp = rsMovies.Fields("Genre")
  12.                 Set nodeX = treView.Nodes.Add(strTemp, tvwChild, , rsMovies.Fields("Title"), "File")
  13.                 nodeX.Tag = "T|" & rsMovies.Fields("MovieID")
  14.                 rsMovies.MoveNext
  15.             Loop
  16.             GoTo Finished