Limit records in combo box

  • Thread starter Thread starter Maran
  • Start date Start date
M

Maran

I want a combo box (which is placed in the sub form) to display only those
rows, which falls under the creiteria given in the main form
 
Maran,
It would have been helpful to include an example, so any response could
be a bit more specific.

You'll want to use the value of some field on the form as a criteria
against that same field in your combobox query.
For example... field [City] = "Boston" on a form.
In the query behind the combo, against the City field, a criteria of...
=Forms!frmYourFormName!City
will filter the records returned in the combo to only "Boston" in the City
field.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
Great thanks a lot, it worked

Al Campagna said:
Maran,
It would have been helpful to include an example, so any response could
be a bit more specific.

You'll want to use the value of some field on the form as a criteria
against that same field in your combobox query.
For example... field [City] = "Boston" on a form.
In the query behind the combo, against the City field, a criteria of...
=Forms!frmYourFormName!City
will filter the records returned in the combo to only "Boston" in the City
field.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Maran said:
I want a combo box (which is placed in the sub form) to display only those
rows, which falls under the creiteria given in the main form
 
Maran,
If, in my example, if you change the value of [City] to something like
"Dallas", do a Requery of your combo... on the AfterUpdate event of [City],
so the combo returned values are always in "synch."
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Maran said:
Great thanks a lot, it worked

Al Campagna said:
Maran,
It would have been helpful to include an example, so any response
could
be a bit more specific.

You'll want to use the value of some field on the form as a criteria
against that same field in your combobox query.
For example... field [City] = "Boston" on a form.
In the query behind the combo, against the City field, a criteria
of...
=Forms!frmYourFormName!City
will filter the records returned in the combo to only "Boston" in the
City
field.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."

Maran said:
I want a combo box (which is placed in the sub form) to display only
those
rows, which falls under the creiteria given in the main form
 
Back
Top