If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
remove filter using code
Hi,
I would like to remove filter in a form so I can then carry out the next action with a combo box. Is there an alternative other than clicking the "Remove Filter" icon on toolbar? Perhaps a code in the combo box property that does it? Any help is much apreciated! Sam |
#2
|
|||
|
|||
remove filter using code
Hi Sam:
Just reset the form's recordsource through code: Table1.RecordSource = "SELECT Table1.* FROM Table1 ORDER BY [Table1].[ddate];" If you are using a ComboBox, you might want to do something like this in its AfterUpdate event: Select Case ComboBox2.Value Case "Filter On" Table1.RecordSource = "SELECT Table1.* FROM Table1 ORDER BY [Table1].[ddate] Where Table1.Acct = 23456;" Case "Filter Off" Table1.RecordSource = "SELECT Table1.* FROM Table1 ORDER BY [Table1].[ddate];" End Select Regards, Al "Sam Kuo" .(donotspam) wrote in message ... Hi, I would like to remove filter in a form so I can then carry out the next action with a combo box. Is there an alternative other than clicking the "Remove Filter" icon on toolbar? Perhaps a code in the combo box property that does it? Any help is much apreciated! Sam |
#3
|
|||
|
|||
remove filter using code
DoCmd.RunCommand acCmdRemoveFilterSort
is exactly the same as clicking the "Remove Filter" icon. You can also set" -----Original Message----- Hi, I would like to remove filter in a form so I can then carry out the next action with a combo box. Is there an alternative other than clicking the "Remove Filter" icon on toolbar? Perhaps a code in the combo box property that does it? Any help is much apreciated! Sam . |
#4
|
|||
|
|||
remove filter using code
DoCmd.RunCommand acCmdRemoveFilterSort
is the same as clicking the "Remove Filter" Icon. You can also use: Me.Filter = "" or Me.FilterOn = False They have different meanings but the end result is the same. See Access VB Help on Filter and FilterOn Property. HTH Van T. Dinh MVP (Access) -----Original Message----- Hi, I would like to remove filter in a form so I can then carry out the next action with a combo box. Is there an alternative other than clicking the "Remove Filter" icon on toolbar? Perhaps a code in the combo box property that does it? Any help is much apreciated! Sam . |
#5
|
|||
|
|||
remove filter using code
Thanks alot! Al, anonymous and Van
Your suggestions have been very helpful Regards, Sam |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Filter macro / code builder help? | StargateFan | General Discussion | 5 | June 24th, 2004 05:39 PM |
Expression - calculating running total | Kathy | Running & Setting Up Queries | 26 | June 22nd, 2004 10:14 PM |
Applying Filter in code | Rob-LMS | Setting Up & Running Reports | 4 | May 26th, 2004 06:56 PM |