[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 327
  • Last Modified:

Record Navigation - Access Form - Disable error message when navigate past last record or before record 1?

I've added Previous and next Record buttons to my form.
How do I prevent error message if the user hits Previous when they are on Record 1?

Thanks
0
OnsiteSupport
Asked:
OnsiteSupport
  • 2
  • 2
1 Solution
 
danishaniCommented:
Do you use an Embedded Macro?
If so, you can trap the error by placing for:

Condition: [MacroError]=2105
Action: StopMacro

Error will not being displayed.

Hope this helps,
Daniel
0
 
danishaniCommented:
See attached:

 Trap error
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
The quick and dirty way for nav buttons is this:



 On Error Resume Next
 DoCmd.GoToRecord , , acNext
 Err.Clear
   
 
 On Error Resume Next
 DoCmd.GoToRecord , , acPrevious
 Err.Clear

mx
0
 
OnsiteSupportAuthor Commented:
WOW!!!! That was easy! Thanks :)
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
That's what the Staples Red button says :-)

Now ... what I posted is cheating just a tad.  You should ... add some error trapping to be technically correct. But for 99% of the time, that works.

You might find this useful also:

http://www.lebans.com/recnavbuttons.htm

mx

mx
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now