Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last Record and run time error message

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
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
 
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
[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top