By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,983 Members | 1,717 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,983 IT Pros & Developers. It's quick & easy.

Handling filters in Ms Access 2000 forms

P: 4
Hi,

I am working on a form which currently does not show data after it has opened.

but i can see the data only when i remove the filters from the form, after opening the form

form displays the componet list which it get from the query.

the problem is

that i have not introduced any kind of filters in the form
in fact in on load and on open properties i inserted
Me.filter = ""

but still i am facing problem with the filters

can you please help me in this regard

thanking you
Oct 20 '06 #1
Share this Question
Share on Google+
7 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Try removing

Me.filter = ""


If there is a filter being generated by a query which is the record source of the form this would be overwriting it.
Oct 20 '06 #2

P: 4
I am inserted the

Me.filter = " "

in the Private Sub Form_Load()
Private Sub Form_Open(Cancel As Integer)

but still i am facing the same problem

and also the form includes a sub

Private Sub Btn_Filter_off_Click()
fi_cnt = fi_cnt + 1
Me.Filter = ""
Me.Btn_Filter_off.Caption = "Filter_off " & fi_cnt
Me.FilterOn = False
End Sub

in fact of all this

still i am unable to see the data in the form

so please help me in this regard

thanking you,
Oct 20 '06 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
How are you loading the filter?

===========================

If you are not loading a filter don't turn it off

Remove

Me.filter = " "

From

Private Sub Form_Load()
Private Sub Form_Open(Cancel As Integer)

Remove

Private Sub Btn_Filter_off_Click()
fi_cnt = fi_cnt + 1
Me.Filter = ""
Me.Btn_Filter_off.Caption = "Filter_off " & fi_cnt
Me.FilterOn = False
End Sub
Oct 20 '06 #4

P: 4
How are you loading the filter?

===========================

If you are not loading a filter don't turn it off

Remove

Me.filter = " "

From

Private Sub Form_Load()
Private Sub Form_Open(Cancel As Integer)

Remove

Private Sub Btn_Filter_off_Click()
fi_cnt = fi_cnt + 1
Me.Filter = ""
Me.Btn_Filter_off.Caption = "Filter_off " & fi_cnt
Me.FilterOn = False
End Sub



I removed all filter code from the form

but still i can not see the data in the form

this form displays the list for componets
which it collects from this query


Private Sub Query_Switch()
Dim the_query As String
the_query = _
"SELECT R35_PFUS_Annex.*, R21Components.ComponentName, " & _
" R21Components.ComponentCount, R21Components.Remark, " & _
" R21Components.PFUS_Document, " & _
" R21Components.SAP_Info_01, R21Components.Valid_Entry, " & _
" R21Components.Marker_for_Selection " & _
" FROM R21Components INNER JOIN R35_PFUS_Annex " & _
" ON R21Components.R21LfdNr = R35_PFUS_Annex.R21LfdNr "
If False = f_query_with_ps_applied Then
the_query = the_query & _
" WHERE (((R35_PFUS_Annex.PFUS_Dok_No) Like 'PS5345*')) "
End If

f_query_with_ps_applied = Not f_query_with_ps_applied
the_query = the_query & " ORDER BY R35_PFUS_Annex.PFUS_Dok_No;"
some_msg = "the Query is: '" & the_query & "'"

Me.RecordSource = the_query
End sub

so please help out

thanking you,
Oct 20 '06 #5

MMcCarthy
Expert Mod 10K+
P: 14,534
To establish if the problem is in your query.

Put the query in a query window and run it. Do all the expected records show?
Oct 20 '06 #6

P: 4
To establish if the problem is in your query.

Put the query in a query window and run it. Do all the expected records show?

can you please tell me how to use the query window
Oct 20 '06 #7

MMcCarthy
Expert Mod 10K+
P: 14,534
All I meant by this is open a new access query and go to SQL view. Put in your sql code (without the line breaks).



can you please tell me how to use the query window
Oct 20 '06 #8

Post your reply

Sign in to post your reply or Sign up for a free account.