|Subject:||Re: Trouble With "For Each" and "Next"|
|Posted by:||Thelma Lubkin (thel…@alpha2.csd.uwm.edu)|
|Date:||29 Aug 2006|
Dale <mtec…@yadtel.net> wrote:
: Access 2000
: The below code works Except it will not stop looping when a control is
: null. It will display the msgBox and then continue to the next control.
: Dim ctl As Control
: For Each ctl in Me,Controls
: If ctl.Tag = "1" And IsNull(ctl) Then
: MsgBox("Required Field Is Blank")
Exit For <================
: End If
: Next ctl
You need to exit the loop: see above.
Trouble With "For Each" and "Next" posted by Dale on 28 Aug 2006