469,286 Members | 2,466 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,286 developers. It's quick & easy.

how to declare more than one variable

I have several variabls that are strings.
How can I put them on one line.
I remember that if you do that, only the last one is the string and the ones
before it are not

like
dim a, b, c as string

the c will only be declared correctly.

Is this the case with access 2002?

Thanks in advance
Dan
Nov 12 '05 #1
4 4814
Am Tue, 13 Apr 2004 15:51:21 +0000 schrieb Danny:
I have several variabls that are strings.
How can I put them on one line.
dim a, b, c as string

the c will only be declared correctly.

Is this the case with access 2002?

Thanks in advance
Dan

Hello,

you have to declare the type of each variable explicit.
You have to type:

Dim a as string, b as string, c as string
HTH

Karpi
<fluctuat nec mergitur>
Nov 12 '05 #2
Danny wrote:
I have several variabls that are strings.
How can I put them on one line.
I remember that if you do that, only the last one is the string and the ones
before it are not

like
dim a, b, c as string

the c will only be declared correctly.

Is this the case with access 2002?

Thanks in advance
Dan


dim a as string, b as string, c as string

I don't code like this,so I'm not sure you need the commas.

Ron

--
Ronald W. Roberts
Roberts Communication
rw*******************@robcom.com
To reply remove "_at_robcom_dot_com"

Nov 12 '05 #3
Thanks

is there any other option?
Do you guys use the option explicit to force correct syntax?

Thanks

"Danny" <da********@hotmail.com> wrote in message
news:Z%*********************@news4.srv.hcvlny.cv.n et...
I have several variabls that are strings.
How can I put them on one line.
I remember that if you do that, only the last one is the string and the ones before it are not

like
dim a, b, c as string

the c will only be declared correctly.

Is this the case with access 2002?

Thanks in advance
Dan

Nov 12 '05 #4
You should always use option explicit imo, cant do any harm to prevent
any extra errors in your code

dim a as string, b as string, c as string

or

dim a as string
dim b as string
dim c as string

what other options are you looking for?
"Danny" <da********@hotmail.com> wrote in message news:<4J*********************@news4.srv.hcvlny.cv. net>...
Thanks

is there any other option?
Do you guys use the option explicit to force correct syntax?

Thanks

"Danny" <da********@hotmail.com> wrote in message
news:Z%*********************@news4.srv.hcvlny.cv.n et...
I have several variabls that are strings.
How can I put them on one line.
I remember that if you do that, only the last one is the string and the

ones
before it are not

like
dim a, b, c as string

the c will only be declared correctly.

Is this the case with access 2002?

Thanks in advance
Dan

Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by rick | last post: by
2 posts views Thread by Jeff Higgins | last post: by
6 posts views Thread by **Developer** | last post: by
8 posts views Thread by redefined.horizons | last post: by
20 posts views Thread by Manuel | last post: by
1 post views Thread by ares.lagae | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.