×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Last Record and run time error message

Last Record and run time error message

Last Record and run time error message

(OP)
Hello,

I am attempting to write code in response to a run time error, 2105 to be exact. The error message that I have successfully created states "you are at the last record."

The problem is that if there are 10 records, the message doesn't appear until the user advances past 10 to the 11th record,which is blank, and then attempts to advance one more by hitting the "next record" command button.

Ideally, I would like the error message to appear without allowing the user to see the blank 11th record.

Any suggestions would be greatly appreciated.

Ash

RE: Last Record and run time error message

Hi Ash,

If the user isn't allowed to add records set the form/subform mode to edit only (user cant add new records)
AllowEdits = false

Or try adding this check on your "next record" command button

If not Me.NewRecord Then
    'movenext 'or what ever method used
else
    msgbox "this is the last record"
end if

HTH

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close