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.
fredg@example.invalid wrote in message news:<ofo000dv0l33b4g69qa9br9mmna006h8n2@4ax.com>. ..[color=blue]
> On 10 Jan 2004 11:53:27 -0800,
fred14214@yahoo.com (fred14214) wrote:
>[color=green]
> >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)[/color]
>
> 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.[/color]