Ahhh ok in that case, the better way is to catch the Err.Number and test it, if there is that one about the last number, juste Resume Next or let display another message more than the standard one. ok in code you mean to :
Private Sub Commande0_Click() On Error GoTo Err_Commande0_Click
DoCmd.GoToRecord , , acNext
Exit_Commande0_Click: Exit Sub
Err_Commande0_Click: If Err.Number = 2499 Then '**** Where 2499 is the number contains error (no more record....) **** Resume Exit_Commande0_Click Exit Sub Else MsgBox Err.Description End If
"krzysztof via AccessMonster.com" <u11875[ at ]uwe> a écrit dans le message de news: 66215d407215b[ at ]uwe...
[Quoted Text] > Jeff, > Thanks for your reply. Usually in access, when you are click through > the records in a form and you reach the last one, you get a message > "Cannot > go to the specified record'. the button is attached to the 'acNext' > command. > There is no 'next' field for Access to go to, hence the error. You are > right, > Access does have a different definition than I do! How can I identify > that > there is not a 'Next' field available, so I do not prompt this error > message? > My table is contsant - with only daily updates inported from another > system. > This was the way it was specified to be designed. Any help is much > appreciated. > > another note: How does one achieve this title of 'MS Access MVP'? > > Jeff Boyce wrote: >>Define "last". >> >>Now ask yourself, "does Access have the same definition that I do?" >>Probably not! >> >>Access tables are "buckets o' data", with no particular order to them. >>"Last" implies something that's being used to order the records. What are >>you using? >> >>Regards >> >>Jeff Boyce >>Microsoft Office/Access MVP >> >>> Good Day! >>> >>[quoted text clipped - 5 lines] >>> >>> > > -- > KMJ >! > > Message posted via AccessMonster.com > http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200609/1>
|