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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrolling through records - error 2105

Status
Not open for further replies.

twoody54

IS-IT--Management
Apr 11, 2002
150
US
Hi,

I have a command button that I use to auto scroll through all the records. It works fine but it stops every 256 records with run time error '2105' You can't go to the specified record. It then points me to this line of code.

If Me.NewRecord Then
DoCmd.GoToRecord acLast
Else

error here----> DoCmd.GoToRecord , , acNext

End If


I'm sure its a simple fix considering it happens at specified intervals, but I'm unsure what to do about it.

Thanks
Tom
 
Hiya,

This code is attempting to go past the EOF marker (last record in table - which is basically the 'new' record when you Addnew).

What is weird is the 'magic number' - 256.

I can't understand your logic anyway.... if you find a 'new' record that has been added by user, then move to the last record, else move to the next record?

Also, this is actually saying: move through records and even if you reach the EOF record - still move to the next (which is why you are getting the error).

Read up on EOF and BOF.

Kind regards,

Darrylle

"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
Well I want it to automatically go through the records. I was going to use it to prevent the user from adding records, but then realized I could eliminate that in the properties. It does stop at the end of all the records without it.

Now I just have it continually scroll without it, but I still get that error every 256 records.
 
To update some more. This definitely occurs at the magic number 256 because I would go to a record such as number 100 and then start the autoscroll but it would stop at at 356 and every 256th record there after.
 
Hi again,

Hang-on, are you using a variable to 'count' the records that you are scrolling through in your 'auto-scroll' command button code?

Regards,

Darrylle




"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
No I am not. I only know that number from looking at the record numbers at the bottom.
 
Tw,

Why are you stating: if Me.NewRecord goto last?

What is your logic behind this?

Remember that NewRecord can be true when Access encounters the EOF marker record (the very last record - that cannot be moved past, and yet you still tell it to move past it - and get your inevitable error).

I'm just curious.

Also, what is your intention in detail please, so that I can offer an alternative - I'm still not clear.

Regards,

Darrylle



"Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
I am no longer using that me.newrecord. I didn't want the scrolling or user to add a new record. Then I realized that I could just set that in the properties.

I simply wanted it to scroll through some records and do various things on the form for each record without having to manually click or use the wheel mouse. I have recently discovered how to manipulate things without scrolling to each record. I only knew how to manipulate forms before, not the entire database or recordset. This is providing me with the answers I need.

I appreciate you trying to help. I wanted something so stupid that its hard for someone who knows what they're doing to understand haha.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top