SpencerGraevn
12-23-2007, 11:12 PM
Hello!
I'm working on an RSS Maker for podcasts, and it's been a while since school, so I've forgotten most of my VB6 training.
I have two tables created in Access: "Channels," which contain ID, CTitle and ITitle; and "MasterList," which contains ID and MTitle.
On my form, I have two ListBoxes called lst_channels, which contains the data from MTitle; and lst_items, which I would like to fill with the information from ITitle.
MasterList/MTitle contains a list of Podcasts.
Channels/ITitle contains a list of episodes.
Channels/CTitle shows which Podcast an Episode belongs to.
The following code allows lst_channels to accept the info from MTitle.
Public Sub FillList()
Dim SQL As String
frm_MRPODCAST.lst_CHANNELS.Clear
frm_MRPODCAST.lst_ID.Clear
frm_MRPODCAST.lst_ITEMS.Clear
frm_MRPODCAST.lst_SORTID.Clear
SQL = "SELECT ID, MTitle FROM MasterList"
RS.Open SQL, CN, adOpenStatic, adLockReadOnly
If RS.RecordCount > 0 Then
RS.MoveFirst
End If
While Not RS.EOF
frm_MRPODCAST.lst_CHANNELS.AddItem RS.Fields("MTitle").Value
frm_MRPODCAST.lst_ID.AddItem RS.Fields("ID").Value
RS.MoveNext
Wend
RS.Close
Set RS = Nothing
End Sub
Here's a picture of the interface:
http://fc03.deviantart.com/fs22/i/2007/357/3/8/mrpodcast_by_Caelhath.jpg
Now, I would like to be able to click on a Channel, such as "The Bridge," and have it display a list of all the episodes associated with that file. I wrote up a sub to do that, but I'm having... difficulty. Here's the code.
Public Sub FillITEM()
Dim SQL As String
frm_MRPODCAST.lst_ITEMS.Clear
frm_MRPODCAST.lst_SORTID.Clear
SQL = "Select CTitle, ITitle FROM Channels where CTitle = " & lst_CHANNELS.List
RS.Open SQL, CN, adOpenStatic, adLockOptimistic
If RS.RecordCount > 0 Then
RS.MoveFirst
End If
While Not RS.EOF
frm_MRPODCAST.lst_ITEMS.AddItem RS.Fields("ITitle").Value
frm_MRPODCAST.lst_SORTID.AddItem RS.Fields("CTitle").Value
RS.MoveNext
Wend
RS.Close
Set RS = Nothing
End Sub
When I click on something in the Channels Listbox, I get an "Arguement not optional" popup. When I delete the part that reads where CTitle = " & lst_CHANNELS.List, it simply displays every episode from every podcast. This is logical, since there are no qualifiers in the query, so what do I need to do in order to just pull up the episodes I want?
Can anybody help? I remember this stuff being so much easier!!! A couple years of not working with a program will do that to ya, I suppose.
I'm working on an RSS Maker for podcasts, and it's been a while since school, so I've forgotten most of my VB6 training.
I have two tables created in Access: "Channels," which contain ID, CTitle and ITitle; and "MasterList," which contains ID and MTitle.
On my form, I have two ListBoxes called lst_channels, which contains the data from MTitle; and lst_items, which I would like to fill with the information from ITitle.
MasterList/MTitle contains a list of Podcasts.
Channels/ITitle contains a list of episodes.
Channels/CTitle shows which Podcast an Episode belongs to.
The following code allows lst_channels to accept the info from MTitle.
Public Sub FillList()
Dim SQL As String
frm_MRPODCAST.lst_CHANNELS.Clear
frm_MRPODCAST.lst_ID.Clear
frm_MRPODCAST.lst_ITEMS.Clear
frm_MRPODCAST.lst_SORTID.Clear
SQL = "SELECT ID, MTitle FROM MasterList"
RS.Open SQL, CN, adOpenStatic, adLockReadOnly
If RS.RecordCount > 0 Then
RS.MoveFirst
End If
While Not RS.EOF
frm_MRPODCAST.lst_CHANNELS.AddItem RS.Fields("MTitle").Value
frm_MRPODCAST.lst_ID.AddItem RS.Fields("ID").Value
RS.MoveNext
Wend
RS.Close
Set RS = Nothing
End Sub
Here's a picture of the interface:
http://fc03.deviantart.com/fs22/i/2007/357/3/8/mrpodcast_by_Caelhath.jpg
Now, I would like to be able to click on a Channel, such as "The Bridge," and have it display a list of all the episodes associated with that file. I wrote up a sub to do that, but I'm having... difficulty. Here's the code.
Public Sub FillITEM()
Dim SQL As String
frm_MRPODCAST.lst_ITEMS.Clear
frm_MRPODCAST.lst_SORTID.Clear
SQL = "Select CTitle, ITitle FROM Channels where CTitle = " & lst_CHANNELS.List
RS.Open SQL, CN, adOpenStatic, adLockOptimistic
If RS.RecordCount > 0 Then
RS.MoveFirst
End If
While Not RS.EOF
frm_MRPODCAST.lst_ITEMS.AddItem RS.Fields("ITitle").Value
frm_MRPODCAST.lst_SORTID.AddItem RS.Fields("CTitle").Value
RS.MoveNext
Wend
RS.Close
Set RS = Nothing
End Sub
When I click on something in the Channels Listbox, I get an "Arguement not optional" popup. When I delete the part that reads where CTitle = " & lst_CHANNELS.List, it simply displays every episode from every podcast. This is logical, since there are no qualifiers in the query, so what do I need to do in order to just pull up the episodes I want?
Can anybody help? I remember this stuff being so much easier!!! A couple years of not working with a program will do that to ya, I suppose.