I use a "next button" to enable user to cycle the data in a form. Behind the click_button I just use runcommand. But i need to prevent this button to create new record - when it arrived at last record. Please help me.
8 4824
Try the following in the ON CLICK event of the button -
On Error GoTo ErrorTrap
-
DoCmd.GoToRecord , , acNext
-
-
ErrorTrap:
-
Select Case Err.Number
-
Case Is = 2105
-
MsgBox "End of Records"
-
Case Else
-
MsgBox (Err.Description & vbCrLf & Err.Number & vbCrLf & Me.Name)
-
End Select
-
cheers,
I use a "next button" to enable user to cycle the data in a form. Behind the click_button I just use runcommand. But i need to prevent this button to create new record - when it arrived at last record. Please help me.
I believe for that code to work, the form's AllowAdditions Property also has to be set to No.
Welcome to bytes!
Linq ;0)>
You are right Linq - I forgot to mention that. I always turn that off and have a button to let a user make chnages or add or delete just so they don't do anything by accident. That way I can have things bound without them changing things without a concerted effort on their part.
cheers,
I believe for that code to work, the form's AllowAdditions Property also has to be set to No.
Welcome to bytes!
Linq ;0)>
Me, too, that's how I spotted it! I actually run all my apps full screen with pretty much everything turned off, using custom buttons to do everything.
Linq ;0)>
I believe for that code to work, the form's AllowAdditions Property also has to be set to No.
Welcome to bytes!
Linq ;0)>
So nice of you ! Thank you..your advise is working now ! And the answer is incredible fast.....!
Try the following in the ON CLICK event of the button -
On Error GoTo ErrorTrap
-
DoCmd.GoToRecord , , acNext
-
-
ErrorTrap:
-
Select Case Err.Number
-
Case Is = 2105
-
MsgBox "End of Records"
-
Case Else
-
MsgBox (Err.Description & vbCrLf & Err.Number & vbCrLf & Me.Name)
-
End Select
-
cheers,
Thanks a lot ! it's working ! The help that immediately arrive....thank a lot !
Well you know what they say .... "Great minds think alike".... or is that ... "Fools seldom differ".
cheers,
Me, too, that's how I spotted it! I actually run all my apps full screen with pretty much everything turned off, using custom buttons to do everything.
Linq ;0)>
You're welcome, glad we could help.
cheers,
Thanks a lot ! it's working ! The help that immediately arrive....thank a lot !
Sign in to post your reply or Sign up for a free account.
Similar topics
by: William Wisnieski |
last post by:
Hello Everyone,
Access 2000,
I have a main unbound form with a bound datasheet subform
. The subform is bound to a query
that returns records based on criteria in the main form. The user...
|
by: Miguelito Bain |
last post by:
hi everybody-
i have a form with 2 fields on it that i want the user to fill out
before he or she can save the record, close the record, or move to the
next record, etc...
here's the code i...
|
by: swingingming |
last post by:
Hi, in the NorthWind sample database, when clicking on the next
navigation button on the new order record with nothing on the subform
(order details), we got an order with nothing ordered. How can...
|
by: D. Shane Fowlkes |
last post by:
This may be a very simple question but I'm stumped none the less.
I have a form where a user provides comments. There's a Grid below this
form which displays all comments in the table so far. On...
|
by: Maria Anthonsen |
last post by:
I have filled a datagrid with data from a dataset. The dataset was filled
with a dataadapter - and I used the wizard to create insert, update, delete
commands.
I would like to prevent the user...
|
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...
|
by: tlyczko |
last post by:
Hello,
I think what I'm asking for may not be possible, but I'll try anyway.
I have MainForm with 3 subforms, one SubForm requires data entry, the
other two don't (optional).
MainForm has...
|
by: bill |
last post by:
I dynamically create buttons and associate them with an event using
AddHandler.
I want all the button events to fire at one time, when the page is posted,
instead of when each button is clicked....
|
by: Michiel Rapati-Kekkonen |
last post by:
Hi,
I would like my record to be saved only when my own close button (with all
it's checks) is used.
I made the winodws close button disappear, but you still can close using the
right mouse...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
|
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...
|
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,...
| |