By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,651 Members | 1,694 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,651 IT Pros & Developers. It's quick & easy.

Chr function

P: n/a
me
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?

Jul 21 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a
me
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?

Jul 21 '06 #2

P: n/a
On 21 Jul 2006 16:05:03 -0700, me wrote:
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?
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 V 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
Jul 21 '06 #3

ADezii
Expert 5K+
P: 8,607
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?
'To find out what all these codes mean simply execute this code within any
'Event (in this case the Click of a Command Button) and view the
'contents of the Immediate Window


Private Sub Command27_Click()
On Error Resume Next

Dim intCounter As Integer

For intCounter = 1 To 255
Debug.Print "Chr(" & Trim(Str(intCounter)) & ") is equivalent to: " & Chr(intCounter)
Next intCounter

End Sub
Jul 22 '06 #4

P: n/a
On 21 Jul 2006 16:37:15 -0700, me wrote:
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?
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
Jul 22 '06 #5

P: n/a
me

fredg

Thanks a lot.

Jul 22 '06 #6

P: n/a
* fredg:
On 21 Jul 2006 16:37:15 -0700, me wrote:
>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?

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.
Excellent response. Rather than providing only the values, how the OP
can get them for himself. Give a man a fish...

Jul 22 '06 #7

P: n/a
Chr(39) = '
Chr(91) = [
Chr(45) = -
Chr(93) = ]
Chr(42) = *

Hope this solves your problem.

Good luck

Nick

me wrote:
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?
Jul 22 '06 #8

P: n/a
.... and he'll smell for a day (?)

--

Terry Kreft
"Randy Harris" <pl****@send.no.spamwrote in message
news:ec********************@newssvr13.news.prodigy .com...
* fredg:
On 21 Jul 2006 16:37:15 -0700, me wrote:
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?
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.

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

Jul 22 '06 #9

P: n/a
me

Nick 'The Database Guy' wrote:
Chr(39) = '
Chr(91) = [
Chr(45) = -
Chr(93) = ]
Chr(42) = *

Hope this solves your problem.

Good luck

Nick
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.

>
me wrote:
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?
Jul 25 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.