![]() |
| |||||||
![]() | « Previous Thread | Next Thread » |
| | LinkBack | Thread Tools | Display Modes |
| Sponsored Links |
| ||||
| You have been working on this for a while now, haven't you? I think you logic is wrong. Based on the code I see, I do not see where you define the recordset "rs". Also, why do you keep referencing the "rs" recordset? Why not store that value in a variable and close the connection? That would be much more efficient. Anways, I am not sure what you are trying to accomplish here? To clean up your code, I would suggest that you use subs to create your selects. For instance, like so: Code: Sub DistrictSelect(intID, intRegionID, intDistrictID)
strSQL = "SELECT DISTINCT Concatenate, DistrictID FROM vmReg_Dist WHERE RegionID = '" & strRegionID & "' ORDER BY Concatenate"
Set objRS = conn.Execute(strSQL)
response.write "<select name=""District" & intID & """ class=""clrBg"">" & vbCrLf
response.write "<option value="""">Select District</option>" & vbcrLf
Do While Not objRS.EOF
response.write "<option value=""" & objRS("DistrictID") & """"
If CStr(objRS("DistrictID")) = CStr(strDistrictID) Then
response.write " selected"
End If
response.write ">" & objRS("Concatenate") & "</option>" & vbCrLf
objRS.MoveNext
Loop
response.write "</select>" & vbCrLf
objRS.Close
Set objRS = Nothing
End Sub
Code: intRegionID = rs("RegionID")
intDistrictID = rs("DistrictID")
intID = 10
Code: <tr> <td><% Call DistrictSelect(intID, intRegionID, intDistrictID) %></td> </tr> |
| ||||
| Hi BLaaaaaaaaaarche, Yes, Ok, let me go and change it back. I had your suggestion before and it did work and make the code cleaner but still couldn't figure how to do an OnChange to update the district list only for the one record with multiple records on the screen. My screen looks similar to this: Region List --District List--Category List--Size List--Desc--more fields Africa Angola Hammer 8" 8" Hammer Africa Congo Hammer 6" 6" Hammer So if I want to change the second record Region to Canada, I can do so but the District list won't show Canada district, it still shows Africas districts. I'll come back once I change the code back and see how I can implement the OnChange or something similar to do this. Thank you ![]() |
| ||||
| Due to inactivity of 14 days, this thread is deemed abandoned and is now closed. If this thread was marked as "Solved", the orginal poster may mark it as "Unsolved" via the Thread Tools menu, thus re-opening the thread. If this thread was not marked as "Solved", the original poster may re-open the thread via the Thread Tools menu. Regards, richyrich DeveloperBarn Forums Moderator |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
| Sponsored Links |
| ASP.NET Resource Index a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer. Free Web Directory Including Chats and Forums Resources, Offer automatic, instant and free directory submissions. | URLZ Web Directory URLZ Web Directory Free Web Directory - Add Your Link The Little Web Directory | Free Web Directory Pegasus free web directory is a free directory organised by categories. Web Directory & SEO Services dirroot web directory |