Hey
Ive got a line of code and its too big to fit on just one line. Is there
anyway i can put it on two lines but logically link it? or do i need to
rewrite the line of code?
Cheers
Mark - 28 Feb 2005 20:55 GMT
In VBA, you can use the underscore character (with a space in front of it)
as a line-break:
If (PrevControlName = "") Or (PrevFormName = "") _
Or (FormName <> PrevFormName) _
Or (ControlName <> PrevControlName) Then
These three lines will be interpreted as one long line of code when it's
run.
> Hey
> Ive got a line of code and its too big to fit on just one line. Is there
> anyway i can put it on two lines but logically link it? or do i need to
> rewrite the line of code?
>
> Cheers
Johnny Bright - 28 Feb 2005 20:57 GMT
Do you mean something other than the line continuation character which is
just a space and underscore?
As in:
If me.txtTextBox <>0 and me.txtAnotherTextBox <1 and me.txtAThirdTextBox _
= something else then
msgbox "Hi"
end if
Notice the space and underscore at the end of the long line.
HTH
John
> Hey
> Ive got a line of code and its too big to fit on just one line. Is there
> anyway i can put it on two lines but logically link it? or do i need to
> rewrite the line of code?
>
> Cheers
David C. Holley - 01 Mar 2005 00:35 GMT
Use the underscore _ character between any naturally occurring space
> Hey
> Ive got a line of code and its too big to fit on just one line. Is there
> anyway i can put it on two lines but logically link it? or do i need to
> rewrite the line of code?
>
> Cheers