473,378 Members | 1,426 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,378 software developers and data experts.

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 3021
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:

CmdPreviousRecord.Enabled = Not Me.CurrentRecord = 1
CmdNextRecord.Enabled = Not Me.CurrentRecord =
Me.RecordsetClone.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.invalid 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:

CmdPreviousRecord.Enabled = Not Me.CurrentRecord = 1
CmdNextRecord.Enabled = Not Me.CurrentRecord =
Me.RecordsetClone.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:

CmdPreviousRecord.Enabled = Not Me.CurrentRecord = 1
CmdNextRecord.Enabled = Me.CurrentRecord = 1 Or Me.CurrentRecord <
Me.Recordset.RecordCount

--
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
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?...
2
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
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...
2
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...
4
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...
0
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...
1
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...
6
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...
2
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
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
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: 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: 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
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.