-----Original Message-----
However I am still mystified as to why the system
automatically enters the unwanted field and record. Before
closing the form, i.e. while it is still visible, the
field still shows a zero entry. It somehow enters the
field after the form's close procedure is initiated. I
can't see that my form is out of the ordinary, so can only
conclude that the problem is endemic with continuous
forms, but find that hard to believe.
If a record is automatically being generated, there must be some code doing so.
Continuous forms are no different from any other forms in this respect.
Continuous forms and forms in "datasheet" view both show a row for a "new"
record, by design, but this doesn't save any data to the table on its own.
Since you appear to be using VBA to execute a delete query, you could, instead,
implement some code in the form's "BeforeUpdate" event procedure to undo the
record if that field is empty, but if there is other code that is behind all of
your troubles, this might just cause another whole set of problems. The "Undo"
code might look like this:
'*********EXAMPLE START
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo Form_BeforeUpdate_Err
'Undo record if a certain field is empty
If Len(Trim(Me![ProblemField]) & "") = 0 Then
Me.Undo
End If
Form_BeforeUpdate_Exit:
Exit Sub
Form_BeforeUpdate_Err:
MsgBox Err.Description
Resume Form_BeforeUpdate_Exit
End Sub
'*********EXAMPLE END
--
Bruce M. Thompson
(e-mail address removed) (See the Access FAQ at
http://www.mvps.org/access)within the newsgroups so that all might benefit.<<
.