Catching Errors Properly

networkmonkey
11-21-2000, 01:38 AM
Using Access2000, The last line in an {Event Procedure} from the function Private Sub btn_AddNetwork_Click()

states:
DoCmd.GoToRecord , "fm_AddNetwork", acNewRec

Which works perfect...however due to rule integrity/validation when a user inputs duplicate information (each record must have a unique #) it will return the error:
----------------------------------
Run-time error '2105':
You can't go to the specified record.
----------------------------------

How do I catch this and return the focus to the form _gracefully_ rather than the _debug_ _end_ options that are presented now?


Many thanks ahead of time ;-)

TroyC

braindead
11-21-2000, 02:48 AM
Hi. I think you can try using an "On Error Goto" Statement to do this.

Regards

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum