Stop after delete going to new record

Rachael

Registered User.
Local time
Today, 17:24
Joined
Nov 2, 2000
Messages
205
Hi All,

I hope I can explain this!

The situation is:

On a continuous form, field1, field2 and field3 - visible, for data entry

On the same form 3 unbound fields that are hidden.

When data is entered in each of the visible fields, after update events copy the entry into one of the unbound fields

me.unbound1=me.field1 etc etc

Then, on the forms on-current event I have

if me.newrecord then
me.field1 = me.unboundfield1
me.field2 = me.unboundfield2
me.field3 = me.unboundfield3
end if

So, when a new record is entered it copies the last entries into the new record automatically.

Do you see what I'm doing.

Anyway the problem is, if the user tries to delete the last record entered, it won't delete. What seems to be happening is that when the record is deleted the cursor is going to the next record which is a new record and making the on-current event work, therefore repopulating with what is the same record we are trying to delete.

How can I stop the focus moving to the new record after delete of the last record?

I have tried putting docmd.gotorecord,,acfirst etc in the on delete events but to no avail.

Perhaps there is a better method of autopopulating fields

Regards, Rachael
 
Thankyou Pat,

I knew someone would understand the exact characteristics of Event Procedures. Its a bit hit-and-miss when you only think you know what they do.

Kind regards,

Rachael
 

Users who are viewing this thread

Back
Top Bottom