How to tell when user has moved off of record being added

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm going to feel real stupid if/when this gets answered, but here goes...

I have a data entry form that goes straight into Add mode when it's loaded.
If the user backs up to any previous record without completing the entry for
the new record, I need to know this. I figured I could use the form's
OnCurrent event for checking, but I am stumped as to how to code it. Even
when the user abandons the new record, Me.Recordset.EditMode still equals
dbEditAdd (2), so as of now I can't tell that he's no longer on the new
record. Checking Me.Recordset.EOF returns False no matter what, so no help
there.

Any suggestions?
 
Randall Arnold said:
I'm going to feel real stupid if/when this gets answered, but here
goes...

I have a data entry form that goes straight into Add mode when it's
loaded. If the user backs up to any previous record without
completing the entry for the new record, I need to know this. I
figured I could use the form's OnCurrent event for checking, but I am
stumped as to how to code it. Even when the user abandons the new
record, Me.Recordset.EditMode still equals dbEditAdd (2), so as of
now I can't tell that he's no longer on the new record. Checking
Me.Recordset.EOF returns False no matter what, so no help there.

Any suggestions?

I'm not sure if this answers your question or not, but consider these
points:

1. The form's Current event fires whenever a different record becomes
the current record. So it will fire when the user goes to a new blank
record, or when the user goes back to a record they previously added.

2. The form's NewRecord property will be True whenever the current
record is a new record that has not yet been saved; False otherwise.

3. Therefore, in the form's Current event, if the form's NewRecord
property is False, the record the user just moved to is an existing
record, not the new record.
 
Beautiful! Thanks, Dirk, I *knew* it would be something simple and I'd feel
like a noob. ; )

Randall
 
Back
Top