473,654 Members | 3,239 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Controlling "Next record" button

Tim
I have used a graphic 'next record' button on a form. How can I stop it
from going past the last existing record? In other words, I don't want it
to take the user to a blank record.

Thanks
Tim
Nov 13 '05 #1
4 6686
You have to have some code for that button. Check in the code... the Form's
RecordsetClone is one source. If you can't determine how, clarify by posting
the code you are using and perhaps someone can make a more concrete
suggestion.

Larry Linson
Microsoft Access MVP
"Tim" <tg@neo.rr.co m> wrote in message
news:GQ******** ***********@fe2 .columbus.rr.co m...
I have used a graphic 'next record' button on a form. How can I stop it
from going past the last existing record? In other words, I don't want it
to take the user to a blank record.

Thanks
Tim

Nov 13 '05 #2
In message <GQ************ *******@fe2.col umbus.rr.com>, Tim
<tg@neo.rr.co m> writes
I have used a graphic 'next record' button on a form. How can I stop it
from going past the last existing record? In other words, I don't want it
to take the user to a blank record.


This code traps that specific error and beeps if the user attempts to go
beyond the last record. The code is in the On Click event handler for a
control called GoNext.

--------------8<--------------------------------------------------8<-----
--------

Private Sub GoNext_Click()
On Error GoTo Err_GoNext_Clic k
DoCmd.GoToRecor d , , acNext

Exit_GoNext_Cli ck:
Exit Sub

Err_GoNext_Clic k:
If Err = 2105 Then
Beep
Else
MsgBox (Str(Err) & " - " & Err.DESCRIPTION )
End If
Resume Exit_GoNext_Cli ck
End Sub

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author. Will work for money.

Nov 13 '05 #3
Bernard,

Using this code, the button still takes me to a blank record at the end and
beeps.
Tim

"Bernard Peek" <ba*@shrdlu.com > wrote in message
news:Ih******** ******@shrdlu.c om...
In message <GQ************ *******@fe2.col umbus.rr.com>, Tim
<tg@neo.rr.co m> writes
I have used a graphic 'next record' button on a form. How can I stop it
from going past the last existing record? In other words, I don't want itto take the user to a blank record.


This code traps that specific error and beeps if the user attempts to go
beyond the last record. The code is in the On Click event handler for a
control called GoNext.

--------------8<--------------------------------------------------8<-----
--------

Private Sub GoNext_Click()
On Error GoTo Err_GoNext_Clic k
DoCmd.GoToRecor d , , acNext

Exit_GoNext_Cli ck:
Exit Sub

Err_GoNext_Clic k:
If Err = 2105 Then
Beep
Else
MsgBox (Str(Err) & " - " & Err.DESCRIPTION )
End If
Resume Exit_GoNext_Cli ck
End Sub

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author. Will work for money.

Nov 13 '05 #4
In message <M7************ *******@fe2.col umbus.rr.com>, Tim Graichen
<Tg*******@neo. rr.com> writes
Bernard,

Using this code, the button still takes me to a blank record at the end and
beeps.
Tim


Sorry, it was only half the solution. Check the form properties and set
"Allow Additions" to no.
--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author. Will work for money.

Nov 13 '05 #5

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

Similar topics

1
2001
by: me | last post by:
I'm building a multi user app where many admins will be making calls to people in one table. I want to keep things simple and find a way to prevent 2 or more admins from working on the same record at the same time. In other words I need a way to go the next "available" record. Any help will be greatly appreciated, please reply here in the NG. Thanks in advance !!
0
1491
by: Alessandro | last post by:
There is a way to "disable" or remove button to go to next month ? I want, for example, that a user can move from 01/01/2003 to 31/12/2003 but not in 2004..... Any idea ?
4
3277
by: johnb41 | last post by:
In my application, the user opens up a Tiff image. (The file does NOT necessarily have to be the first file in the folder; it could by anywhere.) When i'm done viewing (doing whatever) with the image I need to open up the "Next" Tiff file in the folder. This should be done by clicking a button instead of using the FileOpen dialog again and again. Here is my approach, which isn't working: Private Sub BtnNext_Click(ByVal sender As...
3
2218
by: domcatanzarite | last post by:
How would one create a button that on click advances the form to the next "non recurring record" as opposed to the next record. The field the button needs to que from has groups of duplicate values. I need it to advance the form to the next group of duplicate values not just the next record.
1
20662
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 theere are no records after. I do have a command that automatically jumps to the last record after I open the form: Private Sub Form_Load() DoCmd.GoToRecord , , acLast
5
21736
by: Nick Gilbert | last post by:
Hi, I'm using the asp:Wizard control and on some of the steps, I would only like the user to be able to progess to the next step by clicking an image button. Therefore I would like to be able to hide the Next button on these steps. Is there any way to do this? I know you can convert the navigation to a template, but this is a
14
8418
by: princedhump | last post by:
Hi everyone, I am making a game in Visual Basic. I need some help with it. My question is: that when the user would click the Next button on the Form, the next Question should show! I have 15 Questions to show. How can I do that. It's my exam, and I really need your help! Regards Prince Dhump
2
2077
by: MLH | last post by:
I have an A97 form with Allow Edits, Allow Deletions and Allow Additions properties set. Scrolling through records will eventually take me to the end of the records and one more PgDn will take me to a new record. I also have a cmd button on the form to take me instantly to a new record. There are 2 controls on the form I would like disabled whenever I'm at a new record. I want them enabled at all other times. Which event property would...
1
3004
by: SoNew | last post by:
I have a Database form in Single View for users to look-up and/or enter data. When the form loads the combo box is empty, which I like - but the fields in the form are all filled in with what the database sees as the "first" record - which is alphabetically not the first, but is as to the ID field. All that said, I would like the fields to either fill in with the alphabetical first record, or merely blank. I found the code to have it load New -...
0
8379
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8294
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8494
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8596
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7309
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1924
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.