Access combo box design

C

CCFhort

I am trying to set up combo boxes so that when I make a choice in the first
box, it narrows the choices that show up in the drop down box in the second
field? Anyone have any ideas - I am a novice.

PC
 
J

John Vinson

I am trying to set up combo boxes so that when I make a choice in the first
box, it narrows the choices that show up in the drop down box in the second
field? Anyone have any ideas - I am a novice.

PC

Set the COntrol Source property of the second combo to a Query which
references the first combo box. If they are named cboFirst and
cboSecond on form frmMyForm, create a Query based on the table
containing the fields you want in cboSecond; as a criterion on the
field which links the two combos put

=[Forms]![frmMyForm]![cboFirst]

with the brackets and ! marks but your own form and control name.

You need one other tweak: open the form in design view and select
cboFirst. View its Properties; select the AfterUpdate property from
the Events tab and click the ... icon. Choose Code Builder and edit it
to

Private Sub cboFirst_AfterUpdate() ' Access gives you this line
Me!cboSecond.Requery
End Sub ' and this one

John W. Vinson[MVP]
 

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