How do I get 1 combo box to correctly bring up values in another b

R

RTandDesperate

Hello,

I am very new to Microsoft Access and I am using 2003 version. I've been
tasked with making a database to hold violence in schools information. I have
made a form for the clerical assistant to use to enter in new data as it
comes in. On the form I have two combo boxes, School Type and School Name.
What I want to achieve is for when she picks one of the 4 school types from
the 1st combo box, for the 2nd combo box to bring up only a list of those
particular schools, i.e. if she chooses Primary as the school type in the 1st
box, the second box shows a drop down of only the Primary schools, not the
Secondary, Nursery and Special schools, etc.

I have written a query to do this, which is:

SELECT tblSchools.SchoolName
FROM tblSchools INNER JOIN tblSchoolType ON
tblSchools.SchoolType=tblSchoolType.SchoolTypeID
WHERE tblSchoolType.SchoolType=[Forms]![New Incidents Data Entry
Form]![SchoolType];

In the properties for the School combo box, under Event in the After Update
field, I have put an automatic macro which tells it to Requery. I have tried
the Requery macro in the SchoolType combo box, and in both of them together.

Nothing seems to work, please help!
 
B

Beetle

First, the row source query for your School Name combo box should
just be;

Select SchoolName From tblSchools Where SchoolType =
=[Forms]![New Incidents Data Entry Form]![SchoolType];

No need to involve the School Type table in the above. Just make sure that
the bound column of your School Type combo box is the SchoolTypeID.

Then you want to requery the School Name combo box in the After Update
event of the School Type combo box. You can do this using your macro
(assuming that it is written to requery the School Name combo box), or you
can invoke the code builder for the After Update event and simply put the
following line in the procedure;

Me![SchoolNameCombo].Requery
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top