Solved

Access 2010 Filter query by combo box

Posted on 2014-01-13
4
7,224 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

777 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