Search criteria Allen Browne Program

G

Guest

I recently found Allen Browne's Search Criteria program on this site that was
a great answer to a project that I have been trying to do. Everything works
great except for one search criteria.

I have no experience in Visual Basic and do not know how to modify one of my
search criteria strings.

I want to input a value in one of my search criteria text box and get all
records that are equal to or greater than value entered. The code that I have
written only gives me records that match exactly the value that I entered.
There are other search criteria input boxes that filter on other fields. I am
running Access 2002.

My code is:

If Not IsNull (Me.TxtFilterIxx) Then
strWhere = strWhere & "([Ixx] = " & Me.TxtFilterIxx & ") AND "
End If

Any help would be greatly appreciated.
 
A

Allen Browne

The greater-than operator is >

So, for equal-to-or-greater-than, try:

strWhere = strWhere & "([Ixx] >= " & Me.TxtFilterIxx & ") AND "
 
G

Guest

--
GIrwin


Allen Browne said:
The greater-than operator is >

So, for equal-to-or-greater-than, try:

strWhere = strWhere & "([Ixx] >= " & Me.TxtFilterIxx & ") AND "

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

GIrwin said:
I recently found Allen Browne's Search Criteria program on this site that
was
a great answer to a project that I have been trying to do. Everything
works
great except for one search criteria.

I have no experience in Visual Basic and do not know how to modify one of
my
search criteria strings.

I want to input a value in one of my search criteria text box and get all
records that are equal to or greater than value entered. The code that I
have
written only gives me records that match exactly the value that I entered.
There are other search criteria input boxes that filter on other fields. I
am
running Access 2002.

My code is:

If Not IsNull (Me.TxtFilterIxx) Then
strWhere = strWhere & "([Ixx] = " & Me.TxtFilterIxx & ") AND "
End If

Any help would be greatly appreciated.


Allen
Thanks for helping me with this. I added the >= to the string as indicated
but I do not get any results when I run the search. To give you a little more
information on the search program I am running, I have several other fields I
can be searching on. These fields are PartNo, DieNo, ProdGrup, FaceDim, Depth
and the Ixx field. Program works perfect when I search on any one or all of
the other fields. If I put a value in the Ixx search box I get no records. I
ran the debug routine and it shows the value I entered with the = sign before
it. The values in my table for the Ixx field range from 0.75 to about 30.0.

I have checked the sturcture of my criteria string several times but I am
not finding my error. Any further suggestions.

Thanks for your help.
GIrwin
 
A

Allen Browne

So you are still gettting the = operator insted of the >= operator in your
string? You will need to fix that.

If you have combinations of fields in the where string, separated by AND,
only records that match them all will be selected. You can use OR if you
want them satisfied by any of the conditions.

It also matters whether you are talking about Text fields or Number fields.
Text fields sort character by character, so 19 (starting with 1) is less
than 2.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

GIrwin said:
--
GIrwin


Allen Browne said:
The greater-than operator is >

So, for equal-to-or-greater-than, try:

strWhere = strWhere & "([Ixx] >= " & Me.TxtFilterIxx & ") AND "

GIrwin said:
I recently found Allen Browne's Search Criteria program on this site
that
was
a great answer to a project that I have been trying to do. Everything
works
great except for one search criteria.

I have no experience in Visual Basic and do not know how to modify one
of
my
search criteria strings.

I want to input a value in one of my search criteria text box and get
all
records that are equal to or greater than value entered. The code that
I
have
written only gives me records that match exactly the value that I
entered.
There are other search criteria input boxes that filter on other
fields. I
am
running Access 2002.

My code is:

If Not IsNull (Me.TxtFilterIxx) Then
strWhere = strWhere & "([Ixx] = " & Me.TxtFilterIxx & ") AND "
End If

Any help would be greatly appreciated.


Allen
Thanks for helping me with this. I added the >= to the string as
indicated
but I do not get any results when I run the search. To give you a little
more
information on the search program I am running, I have several other
fields I
can be searching on. These fields are PartNo, DieNo, ProdGrup, FaceDim,
Depth
and the Ixx field. Program works perfect when I search on any one or all
of
the other fields. If I put a value in the Ixx search box I get no records.
I
ran the debug routine and it shows the value I entered with the = sign
before
it. The values in my table for the Ixx field range from 0.75 to about
30.0.

I have checked the sturcture of my criteria string several times but I am
not finding my error. Any further suggestions.

Thanks for your help.
GIrwin
 

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