Thanks jwalker343 for the solutions but what i need is to select the items from the combo box and list the selected item that correspond to the database field in the listbox. Using Ms Acess and VBA. After executing the form, I am prompted to enter an input, which is what i dnt want. What i want is to select the item from the combo box and list that items that corresponds to the database field in the listbox. Let say I select "Maths" from the combox box, it should be able to list the studentid of all students courses = Maths

If combobox1.text = "student ID" then
Listbox1.rowsource = "select [studentid] from [student] where courses = "Maths"

The above code segments prompted me to enter a value, If I enter Maths all student id will be listed. I dnt want to be prompted for the value ("Maths") but jux want to make selection and the listbox will be changed dynamically from the selection of the combo box.

Thanks in advance for any reply.

on change event
combobox2.visible = true 'show combo2

If combobox1.text = "student ID" then
combobox2.rowsource = "SELECT [studentid] FROM [tblpeople]"
elseif combox1.text = "Student Name" then
combobox2.rowsource = "SELECT [name] FROM [tblpeople]"
elseif combox1.text = "Student Courses" then
combobox2.rowsource = "SELECT [courses] FROM [tblpeople]"
else
msgbox("Please select a value")
combobox1.getfocus 'sets focus to combo1
combobox2.visible = false 'makes combo2 invisi
endif