VB equivilent of nextline

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?
 
D

dymondjack

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
 
M

Marshall Barton

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
 

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