473,385 Members | 1,341 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.

How to make the next record button in a form stop at the last record ?

Hi,

I was wondering how do I make the next record button on my access 2007 form stop at the last record, I want to make sure that if it does not create a new record if it reaches the last record because I already have all the records locked and an edit button takes care of editing the current record and a New record button is already created. Any help on this one will be appreciated greatly.

Thank you for your help
Sam.
Sep 8 '10 #1

✓ answered by ADezii

If you are really looking for a professional looking Application with Smart/Intelligent Navigation Buttons, you can eliminate Access's Navigation Buttons, and create your own Custom ones that will test for all conditions using the RecordsetClone Property to move the Record Pointer independently of the Form's Recordset. To post the code would be confusing to say the least, so I created a simple demo for you to Download. This demo should provide exactly what you are looking for.

3 9226
jimatqsi
1,271 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. if not recordsetname.eof then
  2.    recordsetname.movenext
  3. else
  4.    msgbox "Sorry, you cannot go past the end of the file"
  5. endif
Sep 8 '10 #2
NeoPa
32,556 Expert Mod 16PB
I'm afraid I don't think that will work Jim. That said, there is no neat way to work this that I've ever found. I would use the following code which I admit is clumsy :
Expand|Select|Wrap|Line Numbers
  1. Call DoCmd.GoToRecord(Record:=acNext)
  2. If Me.NewRecord Then Call DoCmd.GoToRecord(Record:=acPrevious)
Sep 9 '10 #3
ADezii
8,834 Expert 8TB
If you are really looking for a professional looking Application with Smart/Intelligent Navigation Buttons, you can eliminate Access's Navigation Buttons, and create your own Custom ones that will test for all conditions using the RecordsetClone Property to move the Record Pointer independently of the Form's Recordset. To post the code would be confusing to say the least, so I created a simple demo for you to Download. This demo should provide exactly what you are looking for.
Attached Files
File Type: zip Smart.zip (41.5 KB, 822 views)
Sep 9 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Alain Guichaoua | last post by:
Good evening to all Here is my problem : I have a form with a subform. They are linked. When I open the form I would like the subform to reach its last record. I tried the method...
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...
2
by: Randy | last post by:
I put a new record button on a form and I get a message that "you can not go to that record" Would someone tell me what is wrong. I put buttons on both the parent and child tables that go to...
2
by: marko | last post by:
I don't know how to form my question but this is my problem: I would like to fill out a form containing let's say 3 fields and then when i go to the next record. Now the next record would be blank...
1
by: AA Arens | last post by:
I my form I have put record navigation buttons. When I choose just before the last record, the "Go to next record" button, access automatically start with a new record instead of a message that...
17
by: michel.ank | last post by:
Hi, I'm using the class PrintLines and my last record of page aren't with the borders. Somebody can help me? Thanks,
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...
6
by: awojciehowski | last post by:
I am assuming this is an easy fix but I want to open a form from a switchboard button. I also want the form to automatically open to the last record of that form. Any ideas on how I can...
1
by: jlcastrejon | last post by:
Hi everybody, Could someone tell me how to make a report using just the last record of my access 2007 database? Tks. Jose
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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.