D
Derek Brown
Hi all
This is the desperate result of an attempt to simply delete a bloody record
if the only text field on the form is empty.
The fields are Text1 (Text) and ID (AutoNumber)
Private Sub Text1_AfterUpdate()
DoCmd.RunCommand acCmdSaveRecord
DBEngine.Idle dbRefreshCache
DoEvents
DoCmd.SetWarnings False
Me.Requery
Me.Refresh
If ID > 0 Then 'Test to see if record exists. if I try to delete a record
that has already been deleted I get an error
If Text1 = "" Or IsNull(Text1) = True Then
Recordset.Delete
Me.Requery
Me.Refresh
End If
End If
DoCmd.SetWarnings True
End Sub
It cannot be this hard to delete a record if Text1 is empty. Even with all
of this when i delete a record and then try to delete the first record i get
"No Current Record" ERROR I also stumbled on a phrase in a help screen
"depending if you are in immediate update mode" Is there such a thing? If
there is then it is not referred to again in any of the help files. This can
be a frustrating business.
This is the desperate result of an attempt to simply delete a bloody record
if the only text field on the form is empty.
The fields are Text1 (Text) and ID (AutoNumber)
Private Sub Text1_AfterUpdate()
DoCmd.RunCommand acCmdSaveRecord
DBEngine.Idle dbRefreshCache
DoEvents
DoCmd.SetWarnings False
Me.Requery
Me.Refresh
If ID > 0 Then 'Test to see if record exists. if I try to delete a record
that has already been deleted I get an error
If Text1 = "" Or IsNull(Text1) = True Then
Recordset.Delete
Me.Requery
Me.Refresh
End If
End If
DoCmd.SetWarnings True
End Sub
It cannot be this hard to delete a record if Text1 is empty. Even with all
of this when i delete a record and then try to delete the first record i get
"No Current Record" ERROR I also stumbled on a phrase in a help screen
"depending if you are in immediate update mode" Is there such a thing? If
there is then it is not referred to again in any of the help files. This can
be a frustrating business.