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!

How to tell when Docmd.GoToRecord reaches the end

Status
Not open for further replies.

bsagal

Technical User
Jul 17, 2003
35
CA
Hello,

I am using DoCmd.GoToRecord to cycle through a bunch of records automatically.

When the program runs and it reaches the end, an error msg pops up and says that there are no more records and asks to debug.

I don't want the user to see this message, i want the program to know when it reaches the end and I want my own message "Records Updated Successfull" to appear.

Can this be done?

Thanks!
 
if currentrecord <> NewRecord then
DoCmd.GotoRecord

or otherwise start at the end and go back to the start checking that the index isn't -1


*- Stars always welcome -*
 
Chirpyform

FYI...don't ask for stars! They'll kick you off the site for that.

Jim DeGeorge [wavey]
 
Cheers Jim hadn't seen the message and it was just a joke although sometimes people will take a few hours of your time and they get the answer they're looking for without any real recognition....
 
Oh, I hear you about not getting recognition. I once helped a member for almost a week, practically writing the MDB for her and didn't get a star. She did at least say thanks in her response, but didn't come across with the star. I still help people, and I see that you do too...you're all over the place! But, stars are nice if you get 'em! Keep on helping! :)

Jim DeGeorge [wavey]
 
The worst being when you tell them exactly where to look and they can't be bothered and you have to give them the code..... thread702-604148 is a classic although finally the star was given
 
Yeah, that's a bummer too. But, thankfully it hasn't prevented you from continuing to help other members. Says a lot about you and your willingness to help. Nice going!

Jim DeGeorge [wavey]
 
...and as I read this thread I see that the poster hasn't acknowledged the solution yet...
 
AlanKW

Yes, that's part 2 of the Tek-Tip rules. Posters should always acknowledge that a suggestion solved their problem, and they should always post their code to help others.

But in bsagal's defense, the post and suggestion were only entered today. Maybe bsagal didn't see it yet and will eventually acknowledge chirpy's help!

Jim DeGeorge [wavey]
 
Just came back from lunch and i noticed 8 replies!

Thanks very much for your help, I always acknowledge help when i receive it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top