G
Guest
Hi,
I have a subform to be viewed in both datasheet and form view.
When the form is viewed in form view, no problems. When viewed in datasheet
view the following code generates a 'Property not found' error. The offending
line of code is 'CheckMDBF = False' in the function (Well at least if the
line of code is removed, the error stops).
The function is used in a couple of BeforeUpdate events, with the same
error, and only in DS view.
I don't understand why. Can anyone help?
Thanks
swas
Private Sub MDBF_BeforeUpdate(Cancel As Integer)
If Not CheckMDBF Then
'Setting to low, warned in CheckMDBF
Cancel = True
MDBF.Undo
End If
End Sub
Private Function CheckMDBF() As Boolean
'Checks MDBF and fill freq settings are ok
CheckMDBF = True
If FillFrequency > 0 Then
If MDBF < (FillFrequency * 7) + 1 Then
'MDBF will kick fill in before preschedule will
MsgBox "For '" & FillFrequency.Column(1) & "' Pre Schedule setting,
Max Days Between Fills must be > " & _
FillFrequency * 7 & " days.", vbOKOnly, "Max Days Between Fills
Low"
CheckMDBF = False '*** This line of code causes error in datasheet
view
End If
End If
End Function
I have a subform to be viewed in both datasheet and form view.
When the form is viewed in form view, no problems. When viewed in datasheet
view the following code generates a 'Property not found' error. The offending
line of code is 'CheckMDBF = False' in the function (Well at least if the
line of code is removed, the error stops).
The function is used in a couple of BeforeUpdate events, with the same
error, and only in DS view.
I don't understand why. Can anyone help?
Thanks
swas
Private Sub MDBF_BeforeUpdate(Cancel As Integer)
If Not CheckMDBF Then
'Setting to low, warned in CheckMDBF
Cancel = True
MDBF.Undo
End If
End Sub
Private Function CheckMDBF() As Boolean
'Checks MDBF and fill freq settings are ok
CheckMDBF = True
If FillFrequency > 0 Then
If MDBF < (FillFrequency * 7) + 1 Then
'MDBF will kick fill in before preschedule will
MsgBox "For '" & FillFrequency.Column(1) & "' Pre Schedule setting,
Max Days Between Fills must be > " & _
FillFrequency * 7 & " days.", vbOKOnly, "Max Days Between Fills
Low"
CheckMDBF = False '*** This line of code causes error in datasheet
view
End If
End If
End Function