expression.ReturnValue
expression Required. An expression that returns a DSCEventInfo object.
Example
This example uses the BeforeInsert event to prevent the user from adding another record to the recordset once it reaches 75 records.
Sub MSODSC_BeforeInsert(DSCEventInfo)
Dim rstCurrentData
' Set a variable to the recordset.
Set rstCurrentData = DSCEventInfo.DataPage.Recordset
' Check to see if the recordset has reached its limit.
If rstCurrentData.RecordCount >= 75 then
' Display a message to the user.
MsgBox "Cannot add any more records."
' Cancel the insertion of the record.
DSCEventInfo.ReturnValue = False
End If
End Sub