Extra blank line in form

thart21

Registered User.
Local time
Today, 15:43
Joined
Jun 18, 2002
Messages
236
I have a pop-up form in Continuous Forms mode used to enter notes tied to the id field of my main form.

Two fields - notedate and status. Everytime I click in the blank field "status" another blank record always shows up underneath.

I have "notedate" set to auto fill when the focus is set to "status" and this is creating extra records in my table.

Is there a way to stop this from happening?

"Cycle" set to All Records - changed to Current Record with no difference.


Private Sub status_Click()
If IsNull([notedate]) Then
Me.notedate = date
Me.status.SetFocus
End If
End Sub

Private Sub Form_BeforeInsert(Cancel As Integer)
Me.negid = Forms!OpenContracts!negid
End Sub

Thanks,

Toni
 
Open the pop-up form in design view and then click data now set;

Allow Additions = No
 
If I set Allow Additions to "No" I can't add any new records. I do need to do that, I just don't want to see 2 blank records on the form at the same time.

In reading other posts, It doesn't sound like it's possible to fix this, just another Access annoyance along with constantly corrupting tables :(

Thanks for your help.

Toni
 
There is hope in forms when NOT in continuous mode. When you are about to do the update (BeforeUpdate event), check whether the status field is null. If it is, refuse the update.

There is also a possible way to correct this after the fact by running a "cleaner" query.

You can write a DELETE query that tests whether your status field is null as the criterion for removing the record. Then after you close your forms, run the query. Next time you open the form, extra blanks will be gone.
 
Thanks for all the help - the delete query is just what I needed and it works perfectly!
 

Users who are viewing this thread

Back
Top Bottom