Re: Stop a new record appearing

Tech-Archive recommends: Speed Up your PC by fixing your registry



A way I have handled this is to use something like the following in the
form's Current event, where cmdPrev etc. are the names of your command
buttons:

Me.RecordsetClone.MoveLast

'Enable navigation buttons only when there are records available
Me.cmdPrev.Enabled = Not Me.CurrentRecord = 1
Me.cmdFirst.Enabled = Not Me.CurrentRecord = 1
Me.cmdNext.Enabled = (Me.CurrentRecord = 1 And Me.Recordset.RecordCount
1) _
Or Me.CurrentRecord < Me.Recordset.RecordCount
Me.cmdLast.Enabled = (Me.CurrentRecord = 1 And Me.Recordset.RecordCount
1) _
Or Me.CurrentRecord < Me.Recordset.RecordCount

With the Next button disabled at the last record you won't have the option
of going to a new record. The MoveLast line is so the Next and Last buttons
will be enabled if you open the form at the first record. If you are
opening the form to the last record the line of code is not needed.

"Rich Stone" <RichStone@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:75198BEC-006E-49BE-BEC3-A5EEFDD9C598@xxxxxxxxxxxxxxxx
Hi,

As I said, I created my own command buttons. I'm not using the built in
ones. It's the underlying 'next' function that automatically goes to a new
record after the last record. I need to keep the 'next' function but stop
the
'new' record from being displayed.

I hope that's clearer.

"Sprinks" wrote:

Rich,

Eliminate the navigation buttons by setting the form's Navigation buttons
property to No. Create your own forward and backward nav buttons if you
like.

Sprinks


"Rich Stone" wrote:

I have created a basic form for viewing existing data. For this
purpose, I
have set the form not to allow additions. I have also used my own
command
buttons for view first, last, previous and next records. However, when
I
reach the last record, the 'next' button still display a 'new'
record... How
can I stop this?


.


Quantcast