line of code to big to fit on line!! HELP?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
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
 
Back
Top