text field filtering problem

filfil

Registered User.
Local time
Today, 23:14
Joined
Mar 5, 2008
Messages
12
hi all, how are you? this is my first post ^_^

I have a problem with my search form. it was working fine before i connected the access database with the sql server. the code now gets the filtering details and filter the records according to the search criteria only if number and date fields where entered, and it does not work with the test fields!!

i.e. if i entered a text in a text search field, it will return no records!!

i used the same coding as this:
http://allenbrowne.com/ser-62.html

i also tried changing this line:
strWhere = strWhere & "([Region] = """ & Me.txtFilterRegion & """) AND "
to this:
strWhere = strWhere & "([Region] = '" & Me.txtFilterRegion & "') AND "
according to this post:
http://www.access-programmers.co.uk/forums/showpost.php?p=677505&postcount=6

but still not working.. so any help please?!

thanks in advance
 
The filter string looks OK to me....

Ensure that Me.txtFilterRegion actually contains something when placed into the filter string.

MsgBox Me.txtFilterRegion

Make sure the contents within then txtFilterRegion TextBox does not contain apostrophes like Sanderson's Hollow. If it does then you need to do something a little different:

strWhere = strWhere & "[Region] = '" & Replace(Me.txtFilterRegion, "'", "''") & "' AND "

I would stick with using apostrophes (single quote) instead of the triple quotes.

Try getting rid of the parentheses.

Are you turning the Filter ON?: Me.FilterON = True
.
 
thanks a lot ^^

sorry forgot to tell that the fields contain Arabic characters.. i tried a few minutes ago with the English characters and it worked fine.., may be i have to do some changes in the sql table according to:
http://msdn2.microsoft.com/en-us/library/aa902664(SQL.80).aspx

your help is appreciated, thanks... and i hope my problem is gonna be solved.
 

Users who are viewing this thread

Back
Top Bottom