i would like some help with this filter code

M

Moshe

Hi everybody.
I have the following code that should add a filter to my form, the filter
string is exactly as I want it to be, but it only shows 3 records from about
110 that matches this criteria, I don't see any difference between those
records and the rest of my database.

Sub GetCriteria()
Dim FilterCriteria
FilterCriteria = " proposed <> 'previous' And apartmentsearchid = 0 And
inactive = false"
If Not IsNull(Me!FromRoom) Then FilterCriteria = FilterCriteria & " and
rooms >= " & Me!FromRoom
If Not IsNull(Me!ThruRoom) Then FilterCriteria = FilterCriteria & " and
rooms <=" & Me!ThruRoom
If Not IsNull(Me!TypeSearch) Then FilterCriteria = FilterCriteria & "
and type ='" & Me!TypeSearch & "'"
If Not IsNull(Me!SaleRentSearch) Then FilterCriteria = FilterCriteria &
" and salerent='" & Me!SaleRentSearch & "'"
Me.Filter = FilterCriteria
Me.FilterOn = True
End Sub

my problam is with the "" proposed <> 'previous' "" i have also tried ""
not propposed = 'previous' "" and i have the same problem but i removed that
line it wrks perfect but i need to take ddown those what proposed is =
previous.
Please reply thanks in advance.
 
J

John W. Vinson

my problam is with the "" proposed <> 'previous' "" i have also tried ""
not propposed = 'previous' "" and i have the same problem but i removed that
line it wrks perfect but i need to take ddown those what proposed is =
previous.

Moshe, maybe the above is clear to you... but read it from the vantage point
of someone who knows absolutely nothing about your database.

Your query as written should exclude those records where the field named
[Proposed] contains the literal text string 'previous'. But I have no idea
whether that's your intent, or whether there is another field named
[previous], or whether you're actually intending to exclude a
previously-entered value of some sort.

Give us a bit of help here please?

John W. Vinson [MVP]
 
M

Moshe

Thanks John for your help.
My database is for a real estate broker, if some one looks for a apartment
it goes in one table that called search, and if someone have a apartment it
goes to another table called available, when you enter information for a
search their is a commend that opens all available apartments then you enter
the answer of the customer and it goes to a third table called proposal that
is linked to both the search and available,
if you go again to the command it enters the word previous in the proposed
field in all the records that are already in the proposed table linked to the
current record that we are talking about, now the form should not display
wherever their is the word previous and I can't figure out why I don't get
all the records that’s not proposed, I checked the table and the word
previous isn't their in all the records so that means that the problem is
with my filter.
Thanks again



John W. Vinson said:
my problam is with the "" proposed <> 'previous' "" i have also tried ""
not propposed = 'previous' "" and i have the same problem but i removed that
line it wrks perfect but i need to take ddown those what proposed is =
previous.

Moshe, maybe the above is clear to you... but read it from the vantage point
of someone who knows absolutely nothing about your database.

Your query as written should exclude those records where the field named
[Proposed] contains the literal text string 'previous'. But I have no idea
whether that's your intent, or whether there is another field named
[previous], or whether you're actually intending to exclude a
previously-entered value of some sort.

Give us a bit of help here please?

John W. Vinson [MVP]
 
J

John W. Vinson

if you go again to the command it enters the word previous in the proposed
field in all the records that are already in the proposed table linked to the
current record that we are talking about, now the form should not display
wherever their is the word previous and I can't figure out why I don't get
all the records that’s not proposed, I checked the table and the word
previous isn't their in all the records so that means that the problem is
with my filter.

I'd be glad to help if I could, but based on this information there is nothing
that I can contribute.

Do you still have a problem?

If so, please post the SQL view of the query or the full text of the filter,
some representative contents of the tables (actual sample data), and the
result you expect vs. the result you are getting.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top