Function CheckField()
If IsNull(Forms![frmProjectNew]![Project]) Then
Forms![frmProjectNew]![Project].BackColor = 3937500
End If
If IsNull(Forms![frmProjectNew]![Center]) Then
Forms![frmProjectNew]![Center].BackColor = 3937500
End If
MsgBox "The fields in red are required fields", _
vbOKOnly, "Required Field"
End Function
If there is a loop and the macro keep running, then what is the code you are
using to run the Macro, mybe there is an endless loop there.
--
Good Luck
BS"D
Function CheckField() as Boolean
Dim tfContinue as Boolean
tfContinue = True
If IsNull(Forms![frmProjectNew]![Project]) Then
Forms![frmProjectNew]![Project].BackColor = 3937500
tfContinue = False
End If
If IsNull(Forms![frmProjectNew]![Center]) Then
Forms![frmProjectNew]![Center].BackColor = 3937500
tfContinue = False
End If
If tfContinue = false then
MsgBox "The fields in red are required fields", _
vbOKOnly, "Required Field"
End if
CheckField=tfContinue
End Function
Then add a condition to your macro
Condition: CheckField() = False
Action: Stop Macro
If Checkfield returns False then the action will run Stopping the macro if
Checkfield returns True then the Action (Stop Macro) will not run and the
next line in the macro will run.
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.
"djf" <d...@discussions.microsoft.com> wrote in message
news:75005D6C-7385-4D4F...@microsoft.com...
"John Spencer" wrote:
> ..