Try the following code:
=== Code Starts ===
Private Function fTxtBoxFilled () as Boolean
Dim ctlTMP as Control
'Dim strControlTypes as String
fTxtBoxFilled = True
'strControlTypes = "acTextBox;acComboBox;acListBox"
''You have to provide all kind of control types you want to check
separated with ';'
For each ctlTMP in Me.Controls
If ctlTMP.ControlType = acTextBox Then
'If InStr(1, strControlTypes, ctlTMP.ControlType)<>0 Then
If Nz(ctlTMP.Value, "") = "" Then
fTxtBoxFilled = fTxtBoxFilled And False
Else
fTxtBoxFilled = fTxtBoxFilled
End If
End If
Next
End Function
=== Code Ends ===
With this function you can check if all text boxes are filled.
Alternativilly you can un-remark the lines in the code and check for any
type of control.
(You will have to delete thaw one of the two If statements).
Margaritis Paktitis
Ï "tom said:
I am sure this one has been asked before, but I couldn't find an example in the search.
How can I check all of text boxes in my form to ensure that the user has
filled them all in?