Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rating: Thread Rating: 6 votes, 5.00 average. Display Modes
Old 10-06-2010, 04:26 AM   #1
keshavmodi
Registered User
 
Join Date: Oct 2010
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
keshavmodi is on a distinguished road
Filter button on access form

How do we put the filter button on an access form?

I am talking about the simple filter button which when clicked pops up a menu for that field and asks the user to select the relevant data

keshavmodi is offline   Reply With Quote
Old 10-06-2010, 04:59 AM   #2
Trevor G
Newly Registered User
 
Trevor G's Avatar
 
Join Date: Oct 2009
Location: Tamworth, Staffordshire
Posts: 2,331
Thanks: 4
Thanked 229 Times in 219 Posts
Trevor G will become famous soon enough Trevor G will become famous soon enough
Re: Filter button on access form

Welcome to the forum,

When you are in design view on the form there are some tools that appear in your icons at the top of the screen, you need to find the combo box and also make sure the wizard is switche don, then click the icon and click again in the form somwhere, as it starts the wizard you will be prompted and you want to select find a record based on the form, continue through the wizard and select the field to use and then complete the other steps.

Then save the form and change the view and check out the drop down and it will give you your filter.
__________________
Trevor
I am on a learning curve of life, I know a little but like to share what I have learnt with others.
I am using Microsoft Office 2003 To 2016
Please remember everyone here is a volunteer, so if you have had a reply to your thread be courteous and acknowledge this.
Trevor G is offline   Reply With Quote
Old 10-06-2010, 05:11 AM   #3
keshavmodi
Registered User
 
Join Date: Oct 2010
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
keshavmodi is on a distinguished road
Re: Filter button on access form

Thanks for the reply.
But I am afraid it does not answer my question.

In Access 2007 there is an icon for filter in the ribbon.I just want to place that button for filter in my form.Can you help me with that?

keshavmodi is offline   Reply With Quote
Old 10-06-2010, 05:23 AM   #4
Trevor G
Newly Registered User
 
Trevor G's Avatar
 
Join Date: Oct 2009
Location: Tamworth, Staffordshire
Posts: 2,331
Thanks: 4
Thanked 229 Times in 219 Posts
Trevor G will become famous soon enough Trevor G will become famous soon enough
Re: Filter button on access form

Quote:
Originally Posted by keshavmodi View Post
Thanks for the reply.
But I am afraid it does not answer my question.

In Access 2007 there is an icon for filter in the ribbon.I just want to place that button for filter in my form.Can you help me with that?
If you add a command button and then when the wizard starts you would need to select the form section on the left then you will see you can select apply filter, filter by form and filter by selection options
__________________
Trevor
I am on a learning curve of life, I know a little but like to share what I have learnt with others.
I am using Microsoft Office 2003 To 2016
Please remember everyone here is a volunteer, so if you have had a reply to your thread be courteous and acknowledge this.
Trevor G is offline   Reply With Quote
Old 10-06-2010, 05:30 AM   #5
keshavmodi
Registered User
 
Join Date: Oct 2010
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
keshavmodi is on a distinguished road
Re: Filter button on access form

I have tried that method. But it only gives the apply filter, filter by form and filter by selection options. In Access 2007 in the ribbon there is filter icon beside the advance filter menu. When you click on it, a filtering window opens in which you can put a tick across the records for that particular field. I want the functionality of that button on my form. How can it be done?
keshavmodi is offline   Reply With Quote
Old 10-06-2010, 05:55 AM   #6
vbaInet
AWF VIP
 
Join Date: Jan 2010
Location: U.K.
Posts: 26,374
Thanks: 0
Thanked 2,423 Times in 2,389 Posts
vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all
Re: Filter button on access form

Docmd.RunCommand acCmdFilterMenu
vbaInet is offline   Reply With Quote
Old 10-06-2010, 06:03 AM   #7
keshavmodi
Registered User
 
Join Date: Oct 2010
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
keshavmodi is on a distinguished road
Re: Filter button on access form

I tried to put that in the vb code.
However, whenever I click on the button, I get the following message:

Run-time error '2046':
The command or action 'FilterMenu' isn't available now.

keshavmodi is offline   Reply With Quote
Old 10-06-2010, 06:07 AM   #8
vbaInet
AWF VIP
 
Join Date: Jan 2010
Location: U.K.
Posts: 26,374
Thanks: 0
Thanked 2,423 Times in 2,389 Posts
vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all
Re: Filter button on access form

Put the cursor in that field and look at the Filter icon on the ribbon. You will find that the Filter button is not enabled. For example, if the control is not bound you can't apply a filter on it.
vbaInet is offline   Reply With Quote
Old 10-06-2010, 06:11 AM   #9
keshavmodi
Registered User
 
Join Date: Oct 2010
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
keshavmodi is on a distinguished road
Re: Filter button on access form

I had thought of the same thing. But that is not the case. The Filter button is ENABLED. Still I am getting this message.
keshavmodi is offline   Reply With Quote
Old 10-06-2010, 06:14 AM   #10
vbaInet
AWF VIP
 
Join Date: Jan 2010
Location: U.K.
Posts: 26,374
Thanks: 0
Thanked 2,423 Times in 2,389 Posts
vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all
Re: Filter button on access form

Maybe your field is too complex. Is it directly from a table or is it a calculated field?
vbaInet is offline   Reply With Quote
Old 10-06-2010, 06:16 AM   #11
Trevor G
Newly Registered User
 
Trevor G's Avatar
 
Join Date: Oct 2009
Location: Tamworth, Staffordshire
Posts: 2,331
Thanks: 4
Thanked 229 Times in 219 Posts
Trevor G will become famous soon enough Trevor G will become famous soon enough
Re: Filter button on access form

To run the filter option that you want you need a command button and then look at the on click event, you then need a docmd.gotocontrol command and then you can use the acCmdFilterMenu

Private Sub Command10_Click()
DoCmd.GoToControl "Employeename"
DoCmd.RunCommand acCmdFilterMenu
End Sub
__________________
Trevor
I am on a learning curve of life, I know a little but like to share what I have learnt with others.
I am using Microsoft Office 2003 To 2016
Please remember everyone here is a volunteer, so if you have had a reply to your thread be courteous and acknowledge this.
Trevor G is offline   Reply With Quote
The Following User Says Thank You to Trevor G For This Useful Post:
Madmart1gan (10-08-2015)
Old 10-06-2010, 06:17 AM   #12
keshavmodi
Registered User
 
Join Date: Oct 2010
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
keshavmodi is on a distinguished road
Re: Filter button on access form

Its a direct field from a table. And the filter button on the ribbon is working perfectly.
However, the button on the form is not functioning.
keshavmodi is offline   Reply With Quote
Old 10-06-2010, 06:18 AM   #13
vbaInet
AWF VIP
 
Join Date: Jan 2010
Location: U.K.
Posts: 26,374
Thanks: 0
Thanked 2,423 Times in 2,389 Posts
vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all
Re: Filter button on access form

I think Trevor has solved your problem, go to or setfocus to the control before calling the command.
vbaInet is offline   Reply With Quote
Old 10-06-2010, 06:23 AM   #14
keshavmodi
Registered User
 
Join Date: Oct 2010
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
keshavmodi is on a distinguished road
Re: Filter button on access form

It works by setting focus to a particular field. Thank you for the help.

Have a nice day!
keshavmodi is offline   Reply With Quote
Old 10-06-2010, 06:24 AM   #15
vbaInet
AWF VIP
 
Join Date: Jan 2010
Location: U.K.
Posts: 26,374
Thanks: 0
Thanked 2,423 Times in 2,389 Posts
vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all vbaInet is a name known to all
Re: Filter button on access form

Great stuff!!

And you.

vbaInet is offline   Reply With Quote
Reply

Tags
filter , form

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter button in form Anthony Gauci Forms 1 02-06-2015 04:06 PM
Beginner's Guide to ODBC Banana Access FAQs 1 06-18-2009 08:10 PM
Query will not get values from form Cpowell Queries 6 05-21-2009 04:11 AM
Filter by Form button not working with /noruntime Dika At Work General 0 02-27-2006 04:05 AM
enable a button in the filter by form view mdelo Modules & VBA 1 08-01-2001 08:52 AM




All times are GMT -8. The time now is 11:09 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World