MajP
You've got your good things, and you've got mine.
- Local time
- Yesterday, 23:03
- Joined
- May 21, 2018
- Messages
- 8,527
Not sure of the question. The function the user posted would have to be in the forms module since it uses meWhere is the function located please.?
Code:
For Each ctl In Me.Detail.Control
But you could make it generic and place in a module and could be called by any form
Code:
Public Function ValDonorFrm(Frm as access.form) as boolean
Dim bCheck As Boolean
Dim ctl As Control
For Each ctl In frm.Detail.Controls
With ctl
If .Tag = "v" Then
If IsNull(.Value) Then
MsgBox ctl.Name & " is empty, this is a required field!", vbOKOnly, "Required Field"
ctl.SetFocus
valDonorFrm = True
Exit Function
End If
End If
End With
Next ctl
End Function