Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Access 2010 Filter query by combo box

Posted on 2014-01-13
4
7,317 Views
Last Modified: 2014-01-14
Going Crazy,, I was so used to Access 2003.   I now have a continuous form in Access 2010. Control source is query "qry_ElistSearch".  I have a combo box on form, that I want to filter the form using it.  I am not used to embedded macros and all that.  I want to after update filter the form.  The PriKey on the form combobox to match up with PriKey on the query.   I have been out of it for awhile and need to get back into simple Combo Box filtering...  Any help is appreciated.  I had it earlier and lost it...
0
Comment
  • 2
  • 2
4 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39778199
< I am not used to embedded macros and all that.>

you can switch to [Event Procedure] by selecting
File > Options
From the Access Options window, select Object Designers

look for Form/report design view section and check  Always used Event Procedure

do you still need the filtering codes using the afterevent update of the combo box?
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39778209
using the AfterUpdate event of the combo box

private sub comboName_afterupdate()
if me.comboname & ""<>"" then
me.filter="[FieldName]= " & me.comboname

else
me.filter=""

end if

me.filteron=true

end sub
0
 
LVL 4
ID: 39780033
That's It,, thank you.. I will be asking another shortly how to filter by a second cbo box.  Thanks for all your help.. You helped me years ago with other projects.  I am so glad you are still here...
0
 
LVL 4

Author Closing Comment

by:get-ADuser -F ($_.Name -eq "Todd")
ID: 39780058
100 percent perfect and worked like a charm
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question