You might as well just code the solution....
I put in the forms before update:
Cancel = MyVerify
And, my code for MyVerify is:
Private Function MyVerify() As Boolean
Dim colFields As New Collection
MyVerify = False
colFields.Add "Description,De scription"
colFields.Add "City,City"
colFields.Add "cboProvince,Pr ovince"
colFields.Add "StartDate,Star t date"
colFields.Add "EndDate,en d date"
colFields.Add "AccountNo,Acco unt number"
MyVerify = vfields(colFiel ds)
End Function
Private Function vfields(colFiel ds As Collection) As Boolean
Dim strErrorText As String
Dim strControl As String
Dim i As Integer
vfields = False
For i = 1 To colFields.Count
strControl = Split(colFields (i), ",")(0)
strErrorText = Split(colFields (i), ",")(1)
If IsNull(Me(strCo ntrol)) = True Then
MsgBox strErrorText & " is required", vbExclamation, AppName
Me(strControl). SetFocus
vfields = True
Exit Function
End If
Next i
End Function
Eg:
colFields.Add "AccountNo,Acco unt number"
The first part is the control on the screen that we want to validate, and
the 2nd part of the custom "text" message that the user will get:
I paste the above into most screens, and thus I don't have to write a bunch
of code for each control that I want as requited. If the control is null,
then you get a error message, the cursor is also placed on the actual
control that is empty....
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl************* ****@msn.com http://www.attcanada.net/~kallal.msn