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

how to declare more than one variable

P: n/a
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
Share this Question
Share on Google+
4 Replies


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

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

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

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