Linked combo boxes

G

Guest

I have set up a form that has two combo boxes. One is a school list G1, G2
ETC and this is picked up from a table called school. My other combo box call
it (class list) should populate itself with school codes based on what has
been selected in the other combo box. I think I have done this but when I
select the school list nothing is populated in the other class list. However
if I click on that combo box I get a parameter box appearing. Then If I put a
school such as G1 into this parameter box the class list then populates. What
am I doing wrong?

Thanks
 
J

Jeff Boyce

Have you told Access to requery the second combo box in the AfterUpdate
event of the first?

If you are getting a parameter prompt, the spelling of the reference to the
first combo box may be off. Access show a prompt when it doesn't know (or
can't "see") what's being referred to.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
G

Guest

The second box should be based on a query that has two columns: column one
should list the school codes. The second column should list the schools and
have the following in the criteria box:

[forms]![form name]![field name]

(change "form name" and "field name")

The second column should not be visible.

Put the following in the afterupdate event of the first combo:

me.fieldname.requery
 
G

Guest

Thanks for that, it worked a treat.

scubadiver said:
The second box should be based on a query that has two columns: column one
should list the school codes. The second column should list the schools and
have the following in the criteria box:

[forms]![form name]![field name]

(change "form name" and "field name")

The second column should not be visible.

Put the following in the afterupdate event of the first combo:

me.fieldname.requery





Blade370 said:
I have set up a form that has two combo boxes. One is a school list G1, G2
ETC and this is picked up from a table called school. My other combo box call
it (class list) should populate itself with school codes based on what has
been selected in the other combo box. I think I have done this but when I
select the school list nothing is populated in the other class list. However
if I click on that combo box I get a parameter box appearing. Then If I put a
school such as G1 into this parameter box the class list then populates. What
am I doing wrong?

Thanks
 
G

Guest

Hi,
One last question is there any way of blanking the fields after a record has
been saved or when the form is first opened?

Thanks

scubadiver said:
The second box should be based on a query that has two columns: column one
should list the school codes. The second column should list the schools and
have the following in the criteria box:

[forms]![form name]![field name]

(change "form name" and "field name")

The second column should not be visible.

Put the following in the afterupdate event of the first combo:

me.fieldname.requery





Blade370 said:
I have set up a form that has two combo boxes. One is a school list G1, G2
ETC and this is picked up from a table called school. My other combo box call
it (class list) should populate itself with school codes based on what has
been selected in the other combo box. I think I have done this but when I
select the school list nothing is populated in the other class list. However
if I click on that combo box I get a parameter box appearing. Then If I put a
school such as G1 into this parameter box the class list then populates. What
am I doing wrong?

Thanks
 
G

Guest

docmd.gotorecord , , acnew

or something like that!

"On load" event in the form properties

--
www.ae911truth.org



Blade370 said:
Hi,
One last question is there any way of blanking the fields after a record has
been saved or when the form is first opened?

Thanks

scubadiver said:
The second box should be based on a query that has two columns: column one
should list the school codes. The second column should list the schools and
have the following in the criteria box:

[forms]![form name]![field name]

(change "form name" and "field name")

The second column should not be visible.

Put the following in the afterupdate event of the first combo:

me.fieldname.requery





Blade370 said:
I have set up a form that has two combo boxes. One is a school list G1, G2
ETC and this is picked up from a table called school. My other combo box call
it (class list) should populate itself with school codes based on what has
been selected in the other combo box. I think I have done this but when I
select the school list nothing is populated in the other class list. However
if I click on that combo box I get a parameter box appearing. Then If I put a
school such as G1 into this parameter box the class list then populates. What
am I doing wrong?

Thanks
 

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