Solved

Access 2010 Filter query by combo box

Posted on 2014-01-13
4
6,959 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 119

Expert Comment

by:Rey Obrero
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 119

Accepted Solution

by:
Rey Obrero 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now