Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

classic dropdown questioin

Status
Not open for further replies.

mazdaman

Programmer
Oct 17, 2003
55
GB
How do i make a dropdown box populated from a MS Access database.Ive searched the faqs etc but have not found an answer i can work with.

The first dropdown would show a straight list from a table

'Select CourseID, from Coureslist',

Making a selection in this box would then get the details from the following query

'SELECT Applications.*, Courselist.*, Coursetitles.*
FROM Coursetitles RIGHT JOIN (Courselist RIGHT JOIN Applications ON Courselist.CourseID = Applications.CourseID) ON Coursetitles.CourseCode = Courselist.CourseCode
WHERE Courselist.CourseID ='CID'

Courselist = course ID numbers
Coursetitles = titles of the course, has a unique ID containd in the table 'Courselist'
Applications = provids further title information linked to other table (ignore)

Thanks for your help :)
 
The following code should draw out a drop down list populated with your course names. When used within a form, it will send the selected course ID to another page for you to pull out the relevant details. (I have guessed the 'Title' fieldname which may need changing)


SELECT * FROM (CourseList INNER JOIN Coursetitles ON CourseList.CourseID = CourseTitles.CourseCode) ORDER by CourseTitle.Title

%>
<select name="courses"><%
rs.Open strSQL, objCon, 3
If Not rs.EOF Then
Do Until rs.EOF

%><option value="<%=rs("CourseList.CourseID")%>"><%=rs("CourseTitles.Title")%></option><%

rs.MoveNext
Loop
End If
rs.CLose
%></select><%

Nick (Webmaster)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top