Visual Basic help

G

Guest

I am new to VB. I have entered a statement which is too long and therefore
takes up the entire width of the VB window and in some instances I must
depend on my vertical scroll bar too much.

What can I do to split statements and continue on a new line
Example of what I have: "This is just a test statement"

Example of what am looking for(FirstLine) "This is just"
(SecondLine) "A test Statment"

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...-bb2f-841edcac9f86&dg=microsoft.public.access
 
F

fredg

I am new to VB. I have entered a statement which is too long and therefore
takes up the entire width of the VB window and in some instances I must
depend on my vertical scroll bar too much.

What can I do to split statements and continue on a new line
Example of what I have: "This is just a test statement"

Example of what am looking for(FirstLine) "This is just"
(SecondLine) "A test Statment"

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...-bb2f-841edcac9f86&dg=microsoft.public.access

You can split a long line in the VBA code window by using the
Space Underscore combination.

MyVariable = "This is just" _
& "A test Statment"

will equate to:
MyVariable = "This is just A test Statement"
 
D

Douglas J. Steele

The continuation character is an underscore character preceded by a space:

strResult = "This is just " & _
"a test Statment"
 
K

krissco

The line continuation character is "_" (without quotes).

Here is an example:

Msgbox "Hey, this message is kind of long. I think I'll continue it "
_
& "on the next line down."

In this example, the string is continued on the next line. It is
necessary to include the ampersand so that the two lines are properly
concatenated.

You can also use the line continuation char w/o strings:

Function foo(myParam1 as Integer _
myParam2 as String _
myParam3 as Long)


I think VB has a max of 25 line continuation characters.

-Kris
 
M

missinglinq via AccessMonster.com

And you cannot split a string by simply inserting the underscore character.

You can't do

"Now is the time for all good men to _
come to the aid of their country."

but rather

"Now is the time for all good men to" _
& "come to the aid of their country."

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top