By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,968 Members | 1,180 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,968 IT Pros & Developers. It's quick & easy.

How to find out if I'm standing on a new record row in a form?

P: 176
Hi everyone.

For a coding of something which seem too long to explain, I need to find out, by .recordset or any other way, whether or not I (the user) am standing on the new record row in a form.

I've checked .EOF, but it gives me 'False'. I also have checked .AbsolutePosition but it gives me the record number of the last record I was standing on.

Maybe there's some other way, or other property of .recordset I'm not aware about that can distinct the new record row?

Thanks a lot,
Sep 27 '08 #1
Share this Question
Share on Google+
4 Replies

Expert 100+
P: 489
You could catch the "me.recordset.recordcount" value into a form global variable in the forms "On Open" event. Then check your variable against the the current "me.recordset.recordcout" value in the forms "On Current" event.

Personally I would make it impossible for a user to get to a new record unless it was through a control that I placed on the form.
Sep 27 '08 #2

Expert 5K+
P: 8,679
  1. If you are at a New Record on a Form, then the Me.NewRecord Statement will evaluate to True in the Form's Current() Event.
  2. After you invoke the AddNew() Method on a Recordset, the AbsolutePosition Property of the Recordset will evaluate to -1.
Sep 28 '08 #3

Expert Mod 15k+
P: 31,709
Me.NewRecord is the simple answer.

It's hard to find (I keep losing it and struggling to find it again), as it's relative to Me rather than relative to the more intuitive Me.Recordset.
Sep 29 '08 #4

P: 176
Thanks so much, Me.NewRecord works great!
Sep 30 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.