UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Filter Will Not Accept Special Character, Access 2016    
 
   
joelkrywolt
post Feb 23 2018, 11:19 AM
Post#1



Posts: 81
Joined: 18-July 07
From: Leduc, Alberta


Good Morning,

I have a form that uses
CODE
DoCmd.RunCommand acCmdFilterMenu
.

One of my columns is size and it includes the " character to indicate inches. Is there a way I can "handle" the quote character as it does not recognize it?

I tried encapsulating ["], but no luck.
Go to the top of the page
 
theDBguy
post Feb 23 2018, 11:20 AM
Post#2


Access Wiki and Forums Moderator
Posts: 73,276
Joined: 19-June 07
From: SunnySandyEggo


Hmm... Try doubling it.

Just thinking out loud...
Go to the top of the page
 
joelkrywolt
post Feb 23 2018, 11:51 AM
Post#3



Posts: 81
Joined: 18-July 07
From: Leduc, Alberta


I tried 1""" and 1'"' and creates error: please enter a valid character....
Go to the top of the page
 
zaxbat
post Feb 23 2018, 11:54 AM
Post#4



Posts: 1,184
Joined: 26-January 06
From: .....the wiregrass (either you know or you don't)


Also thinking out loud....


wondering if [size"] would push it through


Gads! I have run into so many problems with naming that i just never use anything other than a-z now.
This post has been edited by zaxbat: Feb 23 2018, 11:56 AM
Go to the top of the page
 
truittb
post Feb 23 2018, 12:02 PM
Post#5


Retired Moderator
Posts: 13,587
Joined: 23-June 02
From: Texas (Is there anywhere else?)


How about removing the special character with the Replace() function. Is " in the data you are searching?
Go to the top of the page
 
joelkrywolt
post Feb 23 2018, 12:06 PM
Post#6



Posts: 81
Joined: 18-July 07
From: Leduc, Alberta


Solution works:

If searching for 1-½” NPS, use 1-½[”] NPS
Go to the top of the page
 
theDBguy
post Feb 23 2018, 12:09 PM
Post#7


Access Wiki and Forums Moderator
Posts: 73,276
Joined: 19-June 07
From: SunnySandyEggo


Hi,

Glad to hear you got it sorted out, but I thought you said you tried that approach already and it didn't work.

Good luck with your project.
Go to the top of the page
 
joelkrywolt
post Feb 23 2018, 12:18 PM
Post#8



Posts: 81
Joined: 18-July 07
From: Leduc, Alberta


I tried 1["] hoping that it would find 1" NPS.

And i used it in the "contains" function which I assumed could handle partial strings - it cannot when there is a special character.

What I am saying is: if I want to find 1-½” NPS, I must use 1-½[”] NPS and not 1-½[”]

Go to the top of the page
 
GroverParkGeorge
post Feb 23 2018, 12:23 PM
Post#9


UA Admin
Posts: 33,536
Joined: 20-June 02
From: Newcastle, WA


As someone suggested earlier, the better long-term solution is to replace this, and all other special characters, in all field names. It "works", but there's always a little gotcha to work around. Why incur the extra pain and work when you can change "1-½” NPS" to "1-½in NPS" and be done with it once and for all.
Go to the top of the page
 
joelkrywolt
post Feb 23 2018, 12:45 PM
Post#10



Posts: 81
Joined: 18-July 07
From: Leduc, Alberta


I am working on your recommendation and have reached an obstacle. There seems to be two separate quote characters...

Example 1: 1" NPS
Example 2: 1-½” NPS

Example one is handled using Chr(34), but this does not work for the vulgar fraction quote. Any advice?
Go to the top of the page
 
truittb
post Feb 23 2018, 01:01 PM
Post#11


Retired Moderator
Posts: 13,587
Joined: 23-June 02
From: Texas (Is there anywhere else?)


Use Replace on both sides of the expression to eliminate the special character in the search.

Replace(Replace(<Expression>, Asc(34),"in"),Asc(148),"in") = Replace(Replace(<Expression>, Asc(34),"in"),Asc(148),"in")
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    26th September 2018 - 04:29 AM