|
-
Feb 17th, 2004, 07:48 PM
#1
Thread Starter
Member
Populate A Dropdown From Another Dropdown
I have a page that has two dropdowns on it. When the page loads, the first box is populated from an Access table. Here's the tricky part for me...
(Just when I think I understand how "postback" works, I find I'm wrong again!)
I have the dropdown set to autopostback=true. When the user selects a choice in this dropdown, the page postsback (I think) and I want it to then query another table in the same database to fill the second dropdown list AND keep the original dropdown list's selection.
For some reason, I can get it to fill the original dropdown, but then when it postsback, I get an error because my SQL statement to load the second dropdown looks like this:
Dim objSeriesDA As New OleDb.OleDbDataAdapter("SELECT * FROM Series WHERE fldProviderID=" & lstProvider.SelectedItem.Value & " ORDER BY fldSeriesNumber DESC", objSeriesCN)
Apparently, when the page postsback, the original dropdown list loses its selection, causing the SQL statement above to error out on a null reference.
Any ideas?
If need be, I can throw this up on a server so you all can see what I'm talking about... I can post the full source as well.
Thanks!
HWKY
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|