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
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