Chr function

Chr function

Post by me » Sun, 23 Jul 2006 08:05:03


I am working as an intern at a place using Access 2003 code builder.

Looking at the cold of the old project t(hat we are redoing), I see
Chr(39)

Chr(91)

Chr(45)

Chr(93)

Chr(42)


An example is this:

strCriteria = (strCriteria & tableColumnName & " LIKE " & Chr(39) &
Chr(42 & )vSearchValue & Chr(42) & Chr(39)


I have no books or resource to use - have no VBA or VB.net installed in
my PC; Can anyone tells me what each of these functions returns?
 
 
 

Chr function

Post by me » Sun, 23 Jul 2006 08:37:15

BTW, I tried the following (in access) to see what Chr (39) gives but
it gives erroe message.

Private Sub btntest_Click()
Dim strReturn1 As String
strReturn1 = Chr(39)
Form!label1 = strReturn1

Dim strReturn2 As String
strReturn2 = Chr(91)
Form!label2 = strReturn2

End Sub

Is there any way I can test (in Access) to see what Chr(39) gives?

 
 
 

Chr function

Post by fred » Sun, 23 Jul 2006 08:52:05


Here is how you can find out for yourself what the chr() values are.
Open any VBA code window (i.e. Ctrl + G).
Click on Help.
Select the Index tab.
Type
ASCII
in the Type Keyword box
Click on Search
Then select
Character Set (0 127)
in the Choose a Topic box
and read all of the chr values.
For instance, =chr(91) is the close bracket ( ] ) symbol,
= chr(45) is the hyphen ( - ).

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 
 
 

Chr function

Post by fred » Sun, 23 Jul 2006 10:14:48


Open the debug window (Ctrl + G)
Type
?chr(39)
the character result will appear beneath it
' (the apostrophe)

If you know the character and want to find it's AscII value, type the
character within double quotes.
?Asc("'")
The value will appear beneath it:
39
See my previous reply to your first post for more information.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 
 
 

Chr function

Post by me » Sun, 23 Jul 2006 10:41:17


fredg

Thanks a lot.
 
 
 

Chr function

Post by Randy Harr » Sun, 23 Jul 2006 11:38:02

* fredg:


Excellent response. Rather than providing only the values, how the OP
can get them for himself. Give a man a fish...
 
 
 

Chr function

Post by Nick 'The » Sun, 23 Jul 2006 17:31:05

Chr(39) = '


Chr(91) = [


Chr(45) = -


Chr(93) = ]


Chr(42) = *

Hope this solves your problem.

Good luck

Nick
 
 
 

Chr function

Post by Terry Kref » Mon, 24 Jul 2006 01:05:05

... and he'll smell for a day (?)

--

Terry Kreft
 
 
 

Chr function

Post by me » Thu, 27 Jul 2006 02:02:38


Thanks.

I didn't work yesterday and am about to go find out what those
functiosn are returning and decided to check this thread again. Saves
me some time.