D
Dudley
I am trying to set up error checking to run on exiting records in two
sub-forms and one sub-sub-form. In each case the checks and the control names
are identical. To save writing three different functions, I was hoping to
write one which would run on the before update event on each form. However, I
get error "Invalid use of Me Keyword" on code:
Public Function fnErrorCheckTest()
If Len(Trim(Nz(Me.Type1), "")) <> 0 _
And Len(Trim(Nz(Me.Surname), "")) = 0 Then
fnErrorCheckTest = False
MsgBox "Surname missing"
Exit Function
Else
fnErrorCheckTest = True
End If
End Function
Is there a way round this or do I need to write three functions with full
reference to each control?
Thanks for any help.
Dudley
sub-forms and one sub-sub-form. In each case the checks and the control names
are identical. To save writing three different functions, I was hoping to
write one which would run on the before update event on each form. However, I
get error "Invalid use of Me Keyword" on code:
Public Function fnErrorCheckTest()
If Len(Trim(Nz(Me.Type1), "")) <> 0 _
And Len(Trim(Nz(Me.Surname), "")) = 0 Then
fnErrorCheckTest = False
MsgBox "Surname missing"
Exit Function
Else
fnErrorCheckTest = True
End If
End Function
Is there a way round this or do I need to write three functions with full
reference to each control?
Thanks for any help.
Dudley