473,394 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

OnApplyFilter event works oddly

I woud appreciate some assitance in the following case.

I have a control in the footer of my form name sFilt.

I want to show when the filter is applied and to disappear when no
filter.

In the control source; I have '=Forms!frmCalisto!filter' and it is
visible by default. It works.

However, the show / no show does not work.

Here is what is in the event;

Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
If ApplyType = 1 Then
Me.sFilt.Visible = True
Debug.Print "Filter On"

ElseIf ApplyType = 0 Then
Me.sFilt.Visible = False
Debug.Print "Filter Off"

End If
End Sub

The behavior is as follow;

When I open the form with no filter, the control sFilt doesn't show
(good).
When I apply the filter, the control sFilt will show with the filter
definition (good).
When I remove the filter, nothing basically happens (bad) and in the
debug windows, I always get 'Filter On' even if all records shows.

I have spent 2-3 hours on this. Can anybody point me in the right
direction, please.

Oct 17 '06 #1
1 3135

sa******@hotmail.com wrote:
I woud appreciate some assitance in the following case.

I have a control in the footer of my form name sFilt.

I want to show when the filter is applied and to disappear when no
filter.

In the control source; I have '=Forms!frmCalisto!filter' and it is
visible by default. It works.

However, the show / no show does not work.

Here is what is in the event;

Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
If ApplyType = 1 Then
Me.sFilt.Visible = True
Debug.Print "Filter On"

ElseIf ApplyType = 0 Then
Me.sFilt.Visible = False
Debug.Print "Filter Off"

End If
End Sub

The behavior is as follow;

When I open the form with no filter, the control sFilt doesn't show
(good).
When I apply the filter, the control sFilt will show with the filter
definition (good).
When I remove the filter, nothing basically happens (bad) and in the
debug windows, I always get 'Filter On' even if all records shows.

I have spent 2-3 hours on this. Can anybody point me in the right
direction, please.
If you are removing the filter via code or macro the ApplyFilter event
will not fire. If this is the case explicitly set the state of your
filter control after you remove the filter or explicitly call the
form's ApplyFilter event code, e.g. call Form_ApplyFilter(Cancel,
acShowAllRecords).

Bruce

Oct 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Matthew | last post by:
Is there anyway to tweak this to ignore the function() only if the Tab key is pressed? onkeydown="javascript:function();"
21
by: Alo Sarv | last post by:
Hi From what I have understood from various posts in this newsgroup, writing event loops pretty much comes down to this: while (true) { handleEvents(); sleep(1); // or _sleep() or...
1
by: G.Gerard | last post by:
Hello I am setting the Order By property of a subreport on the On Open Event of the subreport and I am getting the following error: error number 2101 ( The setting you entered isn't valid...
7
by: MGFoster | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Access 2002 & 2003. Windows XP Professional O/S. According to the Access Help article "ApplyFilter Event" the "...ApplyFilter event occurs when...
2
by: hsuntn | last post by:
I'm working with Office Application objects in a client/server WinForm application which allows the user to access remotely stored files. When the user opens the remote file, it is downloaded to...
3
by: KathyB | last post by:
Hi, clearly I'm just not getting something here. I have an aspx form with ONE textbox and several label controls on it. I have the textbox set to AutoPostBack = True, but when I enter my text...
2
by: hecklar | last post by:
This is my first time posting here, so i apologize if i'm posting in the wrong subgroup or whatever, but here goes... I’m having a problem with threading and events (permissions?) in a VB.net...
2
by: glenn | last post by:
Hi folks, I am trying to determine which item in a DropDownList Web control has been selected. I have posted an OnSelectedIndexChanged subroutine in my code with a reference to the subroutine...
3
by: David Vincent | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hello I'm hoping to get some insight into a situation that seems odd to me. My Python experience is limited; I've just started using the unittest module....
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.