Using 2 combo boxes - 2nd one list depending on selection in first

dragginthru

HMTL & CCS expert
Local time
Today, 19:02
Joined
Sep 21, 2005
Messages
63
further question: Using 2 combo boxes - 2nd one list depending on selection in first

(pls see end of thread for further clarification)

Hi

I am trying to achieve the following using 2 combo boxes

Box "a" is a list of courses from tbl_training_courses. The user selects the appropriate course.

Box "b" is a list of dates for each course from tbl_course_dates. Thus the user can select which date per course they want to book someone onto, and this value is then stored in tbl_training_record as the date the person is booked onto.

Its not working!!! It either displays blank values, or it starts a parameter query which I didnt want.

In the combo wizard, access refers to "remembering the value selected for later use" - i guess this might be what I need to use, remembering the value from the first and using it to select rows for the 2nd box based on identical courseID - but I can't seem to find this in Help file.

Any ideas anyone?
 
Last edited:
If you search the forum, you can find this topic covered as 'cascading combo boxes'

:) :)
 
dragginthru,

You can requery the second combo immediately after updation of the first combo. The record source of second combo box should have a criteria to display only those records that are based on first combo value.

For more clarificaton I attached the combo box example for you.

Hopefully it would help.

With kind regards,
Ashfaque
 

Attachments

Last edited:
Brilliant, that makes perfect sense with your example :)

Thanks very much!

Gazz
 
Right, I thought I had this nailed but my SQL syntax is not good enough!

I understand the principles here but can't put it into code.


tbl_training_courses: courseID(pk), course_title
tbl_course_dates: courseID, course_date, coursedateID(pk)


The example Zip file above works fine, but i cant translate it to mine as the course_title comes from a different table than the dates. The dates table has only the ID not the title...

Not sure if that makes sense...
 
This is my lame attempt so far... the table/field names may differ slightly from my earlier list but i dont think that is the cause as they are correct in terms of the db although not standardised...


SELECT [Training Courses].course_title, tbl_course_dates.course_date

FROM tbl_course_dates, [Training Courses]

WHERE [Training Courses].course_title=Forms![Training Record]!course_title_combo

AND [Training Courses].courseID=tbl_course_dates.courseID

ORDER BY tbl_course_dates.Course_Date;
 
dragginthru,

If it does not matter you, kindly send me your file in zip mode to take look. The zip file should be with minimum data records. Let me see what I could for you.

Regards,

Ashfaque_Online@yahoo.com
 

Users who are viewing this thread

Back
Top Bottom