B
Bill R via AccessMonster.com
I'm trying to cancel a prohibited deletion of an existing date in a textbox
in a record on a continuous subform. What I want to happen is, when the
resulting change to the data is Null, display a message stating it is
prohibited, and revert to the value that was there before the user deleted it.
I run the following code in the before update event of the finish date txtbox:
If IsNull(Me.ActiveControl) Then
Set db = CurrentDb()
Set rs = db.OpenRecordset(strSQL)
If Not (rs.EOF And rs.BOF) Then
MsgBox strMsg, vbOKOnly + vbExclamation, strTitle
Me.ActiveControl.Undo
Cancel = True
Me.Dirty = False
End If
rs.Close
Set rs = Nothing
Set db = Nothing
End If
If there are no records in the underlying data that have an open finish date,
then rs will return no records and the null will be permitted.
The msg box displays properly, but when I hit OK, the box is still null. How
do I make this work?
Bill
in a record on a continuous subform. What I want to happen is, when the
resulting change to the data is Null, display a message stating it is
prohibited, and revert to the value that was there before the user deleted it.
I run the following code in the before update event of the finish date txtbox:
If IsNull(Me.ActiveControl) Then
Set db = CurrentDb()
Set rs = db.OpenRecordset(strSQL)
If Not (rs.EOF And rs.BOF) Then
MsgBox strMsg, vbOKOnly + vbExclamation, strTitle
Me.ActiveControl.Undo
Cancel = True
Me.Dirty = False
End If
rs.Close
Set rs = Nothing
Set db = Nothing
End If
If there are no records in the underlying data that have an open finish date,
then rs will return no records and the null will be permitted.
The msg box displays properly, but when I hit OK, the box is still null. How
do I make this work?
Bill