473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

error checking for DoCmd.GoToRecord acNext when it is the last record

Hey folks --

I'm using the DoCmd.GoToRecord , , acNext to jump to the next record
after the user enters a value. The problem is, it throws an error if
it's already on the last record! What's the best way to prevent this?

Steve Lefevre
Nov 13 '05 #1
1 17118
STeve Lefevre <le********@osu.edu> wrote in
news:AA*****************@fe1.columbus.rr.com:
Hey folks --

I'm using the DoCmd.GoToRecord , , acNext to jump to the next
record after the user enters a value. The problem is, it
throws an error if it's already on the last record! What's the
best way to prevent this?

Steve Lefevre


If Me.Recordset.AbsolutePosition + 1 < Me.Recordset.RecordCount
Then
DoCmd.GoToRecord , , acNext
End If

Watch the word wrap.

Bob Quintal
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sixsoccer | last post by:
I have built a database with a <Mainform> and a <Subform>. My problem is twofold. 1. My subform is set as a continuos form with AllowAddiotions set to NO (ie. a list of Issues to the client on...
3
by: BLUE WATER | last post by:
Hi, I have managed to simplify my problem but can't seem to get this to work. I want to open up a form from a click event of another form, but not only open the form when the button is pressed...
0
by: Timppa | last post by:
Hi, I'm converting ACCESS 2000 database to SQL Server. I have .adp project. In the .mdb I have form where I'll insert rows into two different tables using docmd.GoToRecod ,,acNewRec. In .adp...
1
by: vostrixos | last post by:
Hi all,i need some help I'm working on a access project were i use a lot the docmd.gotorecord ,,next ..first ..last method and i use only once the DoCmd.GoToRecord , , acNewRec.Everything was...
3
martintallett
by: martintallett | last post by:
Help! I am trying to replace the Access Find button functionality on an old database. I can make it work when I use a basic form with bound fields and a button which shows a popup form which...
2
by: Bhujanga | last post by:
I want to scroll through records on an open form and take certain actions based on various criteria. So I want to have a loop such as this: Do While Not Last Record <----- ? ....actions.... ...
1
by: gavm360 | last post by:
Hello, I have a subform that has a command button to move to the next record. If there are more records i would just like to move to the next record, When the last record is reached I would like...
2
by: aaronyoung | last post by:
I have been using this forum to answer many questions regarding an Access database I am building (my first attempt at something like this - teaching myself as I go), and I've always been able to find...
8
by: internetintern | last post by:
hello, I have a code like: Private sub button1_Click() DoCmd.FindRecord Me.fieldname.Value, acStart, , acSearchAll, , , False end sub but the problem is that the command stops searching at...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.