what's the difference...(chr(13)) and vbCr 
Author Message
 what's the difference...(chr(13)) and vbCr

What is the difference between using (chr(13)), (chr(10)), vbCr, and
vbCrLf? They all seem to do the same thing...start a new line.

I have been having a few problems with (chr(13)) when I run my program
on different machines and wondered if I should switch to one of the
vbxxxx styles. Do they use different libraries?

The application I'm writing is in Access 97 and I intend converting it
to Access 2000.

--
There can't be a crisis today; my schedule is
already full.

Sent via Deja.com
http://www.*-*-*.com/



Wed, 23 Jul 2003 06:42:17 GMT  
 what's the difference...(chr(13)) and vbCr

Quote:

>What is the difference between using (chr(13)), (chr(10)), vbCr, and
>vbCrLf? They all seem to do the same thing...start a new line.

>I have been having a few problems with (chr(13)) when I run my program
>on different machines and wondered if I should switch to one of the
>vbxxxx styles. Do they use different libraries?

>The application I'm writing is in Access 97 and I intend converting it
>to Access 2000.

>--
>There can't be a crisis today; my schedule is
>already full.

Cheryl

The vbxxxx are all intrinsic VBA constants, and I tend to use them to improve
the readability of my VBA code. Unfortunately, they can't be used outside
modules, so in queries, and for controls and forms and reports, you will need
to use the appropriate Chr value. vbCr and vbCrLf are not equal - vbCr is equal
to Chr(13), whilst vbCrLf is equal to Chr(13) & Chr(10), although often you can
get away with just the one.

These will work happily under both A97 and A2K, so there is no need to convert
to one or the other if you are looking to convert your application. The fact
that your database doesn't like Chr(13) on some machines is possibly a
reference problem, but changing to using VBA constants will probably just hide
the problem, rather than fixing it. If you post back with what sort of problems
you are having, somebody can help you fix them.

Jon

Access tips & tricks - http://www.applecore99.freeserve.co.uk
Microsoft Access webring -
http://nav.webring.yahoo.com/hub?ring=microsoftaccess



Wed, 23 Jul 2003 14:30:55 GMT  
 what's the difference...(chr(13)) and vbCr
If you have ever imported a text file and seen the little square instead of
a new line you will find that it is just a CHR(13). If you replace it with
CHR(13) & CHR(10) then the square will go away and a new line will start. It
is best to use the 2 together.
--
Joe
Access MVP
Check out Dev Ashish's web site for answers to common questions
http://www.mvps.org/access/


Quote:


> >What is the difference between using (chr(13)), (chr(10)), vbCr, and
> >vbCrLf? They all seem to do the same thing...start a new line.

> >I have been having a few problems with (chr(13)) when I run my program
> >on different machines and wondered if I should switch to one of the
> >vbxxxx styles. Do they use different libraries?

> >The application I'm writing is in Access 97 and I intend converting it
> >to Access 2000.

> >--
> >There can't be a crisis today; my schedule is
> >already full.

> Cheryl

> The vbxxxx are all intrinsic VBA constants, and I tend to use them to
improve
> the readability of my VBA code. Unfortunately, they can't be used outside
> modules, so in queries, and for controls and forms and reports, you will
need
> to use the appropriate Chr value. vbCr and vbCrLf are not equal - vbCr is
equal
> to Chr(13), whilst vbCrLf is equal to Chr(13) & Chr(10), although often
you can
> get away with just the one.

> These will work happily under both A97 and A2K, so there is no need to
convert
> to one or the other if you are looking to convert your application. The
fact
> that your database doesn't like Chr(13) on some machines is possibly a
> reference problem, but changing to using VBA constants will probably just
hide
> the problem, rather than fixing it. If you post back with what sort of
problems
> you are having, somebody can help you fix them.

> Jon

> Access tips & tricks - http://www.applecore99.freeserve.co.uk
> Microsoft Access webring -
> http://nav.webring.yahoo.com/hub?ring=microsoftaccess



Tue, 29 Jul 2003 10:13:12 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Inserting Returns with code vbCr or Chr(13)

2. Chr(10) and Chr(13) doesn't work

3. chr(10) and chr(13) in memofield gives |

4. Chr(10) & Chr(13)

5. is carriage return chr(13) or chr(32)

6. INPUT OR READ TO STRIP CHR(10) AND CHR(13)

7. What is chr$(13) + chr$(10)

8. vbCRLF = chr(13) + chr(10)

9. Chr(13) doesn't create paragraph

10. Difference between chr(34) and chr(160)

11. Enter Parameter value CHR(13)

12. Appending chr(13) to a memo field?

 

 
Powered by phpBB® Forum Software