473,770 Members | 5,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form Record Navigation

Dear Group:

I have built and customized a form using the wizard to put command
buttons that will move to the NEXT record or PREVIOUS record. This
works, but it needs some refinement.

Presently, if I am on the first record and click the PREVIOUS record
button, I get some built in, generic Access message. And, if I am on
the last record from the table and I click the NEXT record button, I
am advanced to the *new* record row in the table.

What I would like to happen- if I am on the first record and click
PREVIOUS, I would like Access to give my own message such as *This is
the first record*. Or, if I am on the last record and click NEXT, I
don't want the form to read the blank row- rather I want Access to
fire a message that *This is the last record*.

I am not that fluent with VBA, can someone please give me a hand?
Thanks.

(version- Access 2002)
Nov 12 '05 #1
3 3046
On 10 Jan 2004 11:53:27 -0800, fr*******@yahoo .com (fred14214) wrote:
Dear Group:

I have built and customized a form using the wizard to put command
buttons that will move to the NEXT record or PREVIOUS record. This
works, but it needs some refinement.

Presently, if I am on the first record and click the PREVIOUS record
button, I get some built in, generic Access message. And, if I am on
the last record from the table and I click the NEXT record button, I
am advanced to the *new* record row in the table.

What I would like to happen- if I am on the first record and click
PREVIOUS, I would like Access to give my own message such as *This is
the first record*. Or, if I am on the last record and click NEXT, I
don't want the form to read the blank row- rather I want Access to
fire a message that *This is the last record*.

I am not that fluent with VBA, can someone please give me a hand?
Thanks.

(version- Access 2002)


How about just disabling each of the command buttons as needed:

In the Form's Current event:

CmdPreviousReco rd.Enabled = Not Me.CurrentRecor d = 1
CmdNextRecord.E nabled = Not Me.CurrentRecor d =
Me.RecordsetClo ne.RecordCount

No need to show a message or click OK to go on.

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.
Nov 12 '05 #2
Hi: Thanks for your time and input. I have done exactly as you said
(except for substituting in my names for the command buttons) and this
is the result.

When I open the form by double clicking its name from the Forms
window, both buttons are disabled.

If I open the form in Design View and then click the View button, then
sometimes the NEXT button is in an Enabled state.

How can I fix this?

Thanks.

fr***@example.i nvalid wrote in message news:<of******* *************** **********@4ax. com>...
On 10 Jan 2004 11:53:27 -0800, fr*******@yahoo .com (fred14214) wrote:
Dear Group:

I have built and customized a form using the wizard to put command
buttons that will move to the NEXT record or PREVIOUS record. This
works, but it needs some refinement.

Presently, if I am on the first record and click the PREVIOUS record
button, I get some built in, generic Access message. And, if I am on
the last record from the table and I click the NEXT record button, I
am advanced to the *new* record row in the table.

What I would like to happen- if I am on the first record and click
PREVIOUS, I would like Access to give my own message such as *This is
the first record*. Or, if I am on the last record and click NEXT, I
don't want the form to read the blank row- rather I want Access to
fire a message that *This is the last record*.

I am not that fluent with VBA, can someone please give me a hand?
Thanks.

(version- Access 2002)


How about just disabling each of the command buttons as needed:

In the Form's Current event:

CmdPreviousReco rd.Enabled = Not Me.CurrentRecor d = 1
CmdNextRecord.E nabled = Not Me.CurrentRecor d =
Me.RecordsetClo ne.RecordCount

No need to show a message or click OK to go on.

Nov 12 '05 #3
On 11 Jan 2004 09:05:01 -0800, eo*******@yahoo .com (fred14214) wrote:
Hi: Thanks for your time and input. I have done exactly as you said
(except for substituting in my names for the command buttons) and this
is the result.

When I open the form by double clicking its name from the Forms
window, both buttons are disabled.

If I open the form in Design View and then click the View button, then
sometimes the NEXT button is in an Enabled state.

How can I fix this?

Thanks.

fr***@example. invalid wrote in message news:<of******* *************** **********@4ax. com>...
On 10 Jan 2004 11:53:27 -0800, fr*******@yahoo .com (fred14214) wrote:


Yup, you're right.

Change the code to the following:

CmdPreviousReco rd.Enabled = Not Me.CurrentRecor d = 1
CmdNextRecord.E nabled = Me.CurrentRecor d = 1 Or Me.CurrentRecor d <
Me.Recordset.Re cordCount

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.
Nov 12 '05 #4

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

Similar topics

1
18452
by: Mark | last post by:
I am using an acess form to have people enter data for a small scale audit. Is it possible to hide the bar at the bottom of a form so that the people entering data cannot navigate through records? I would like to make it so that they can only see the record they are working on, and can only add a record by hitting an action button that says "Add Record." Thanks, Mark
2
10586
by: Smriti Dev | last post by:
Hi There, In my access form, I do not want the record navigation button in the bottom to display. How can I hide it from the interface? Thanks, Smriti
1
4012
by: Simon | last post by:
Dear reader, With a combobox I can go to a selected record picked in the pull down list. And in the same time the record navigation field shows the selected record number from the selection.
2
2140
by: editprod | last post by:
The default window for forms is too deep to show the bottom record navigation icons. I checked different workstations (hi-res, how-res, 15" and 17" monitors) and it's the same -- a tad too deep. It confuses co-workers, who have to maximize the form window to easily see the icons. Is there any way to reduce the height of the form window?
4
1916
by: AA Arens | last post by:
I amde a helpdesk database and on the calls form I put record navigation buttons / / / / / / Is het possible to navigate / through the records with a certain status. Each call has a certain status with is set via an Option Group and filled in the Status colomn in the Calls table. Bart
0
1750
by: Andy_Khosravi | last post by:
I'm having a problem trying to optimize the performance of one of my A97 databases. I have very slow record navigation after a change I made to the table structure, and I'm not sure how best to correct it. For purposes of explanation, lets say I have two tables: tblIssues and tblLocationHistory. The tblIssues table contains 'incidents' along with the incident header information. The tblLocationHistory table contains a list of all...
1
4253
by: RLC603 | last post by:
I have a form with subform which details documents within a contract and data elements within the documents. The form contains info. about the contract and one or several documents associated with the contract based on section_id. The form displays only one document at a time. The subform contains data elements associated with a contracts documents based on section_id. Using the form navigation bar, or code associated with a...
6
7989
by: MarkoBBC | last post by:
Hi everyone, First a brief description of my form: I have a subform within a main form. In my subform, I have a listbox displaying address information by firm name. A user first has to select a firm name in a combo box above the list box. The listbox and the combo box join on firm name. The listbox records what address was selected in the address table by the way of an address id number. I set up a macro to requery the listbox when you...
2
41594
by: Brad Williams | last post by:
I have a linked Sub Form in Access 2007. It is designed to only show one Record. (Always 1). How do I Hide / Remove the Record Navigation bar for the subform? Thanks Brad
0
9595
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
9432
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
10232
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...
0
9873
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
8891
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...
0
6682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5454
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2822
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.