VB equivilent of nextline

  • Thread starter Thread starter vtj
  • Start date Start date
V

vtj

What is the Visual Basic command to go to the next line? I have a If
statement (If TypeOf ctlCurr Is PageBreak Then nextline Else rst1!Width =
ctlCurr.Width) but obviously the nextline does not work. I just want it to
process the next line in the code. What is the proper command?
 
I'm not sure if there is one. However, you can restructure your expression a
bit to produce the results you're looking for.

If TypeOf ctlCurr Not PageBreak Then
rst!width = ctlCurr.Width
End If

I think this would essentially do the same thing.

--
Jack Leach
www.tristatemachine.com

- "Success is the ability to go from one failure to another with no loss of
enthusiasm." - Sir Winston Churchill
 
vtj said:
What is the Visual Basic command to go to the next line? I have a If
statement (If TypeOf ctlCurr Is PageBreak Then nextline Else rst1!Width =
ctlCurr.Width) but obviously the nextline does not work. I just want it to
process the next line in the code. What is the proper command?


The "proper" command is no command at all. Just code it so
there is nothing to do in that case. I would code it this
way:

If ctlCurr.ControlType <> acPageBreak Then
rst1!Width = ctlCurr.Width
End If

You could put it all on one line:

If ctlCurr.ControlType <> acPageBreak Then rst1!Width =
ctlCurr.Width

or, the same thing on a continued second line:

If ctlCurr.ControlType <> acPageBreak _
Then rst1!Width = ctlCurr.Width

or, more like your attempt, but I think the more clumsy:

If ctlCurr.ControlType = acPageBreak Then
Else
rst1!Width = ctlCurr.Width
End If
 
Back
Top