Maximizing Connectivity & Productivity

MS Access – Validate controls on form

Use this code on the BeforeUpdate event. Name your controls so that the user will know which box they must complete.

For each ctl in frm.controls
If isnull(ctl.value) then
Msgbox “Please enter ” & ctl.Name
Exit Sub
End if

If there is any control they need not complete add another If statement to exclude it.

Leave a Reply

You must be logged in to post a comment.

Mississauga, ON, Canada 905.607.3500