From: Ranjith Kurian on
I have a table which is linked to a form, i would like to have a command
button which will add a new record to my table.
On the click of command button it should view the last empty row of my table
in a form.
From: John W. Vinson on
On Sat, 26 Dec 2009 11:11:01 -0800, Ranjith Kurian
<RanjithKurian(a)discussions.microsoft.com> wrote:

>I have a table which is linked to a form, i would like to have a command
>button which will add a new record to my table.
>On the click of command button it should view the last empty row of my table
>in a form.

The Click event should show [Event Procedure], and the code could be

Private Sub buttonname_Click()
DoCmd.GoToRecord acDataForm, Me.Name, acNewRecord
End Sub


Or you could use a Macro using the Go To Record action.
--

John W. Vinson [MVP]
From: Ranjith Kurian on
Thanks for the below code.

I even need a command button to delete the record in a table.

"John W. Vinson" wrote:

> On Sat, 26 Dec 2009 11:11:01 -0800, Ranjith Kurian
> <RanjithKurian(a)discussions.microsoft.com> wrote:
>
> >I have a table which is linked to a form, i would like to have a command
> >button which will add a new record to my table.
> >On the click of command button it should view the last empty row of my table
> >in a form.
>
> The Click event should show [Event Procedure], and the code could be
>
> Private Sub buttonname_Click()
> DoCmd.GoToRecord acDataForm, Me.Name, acNewRecord
> End Sub
>
>
> Or you could use a Macro using the Go To Record action.
> --
>
> John W. Vinson [MVP]
> .
>
From: John W. Vinson on
On Sat, 26 Dec 2009 21:38:01 -0800, Ranjith Kurian
<RanjithKurian(a)discussions.microsoft.com> wrote:

>Thanks for the below code.
>
>I even need a command button to delete the record in a table.

The toolbox Command Button Wizard will offer this as a choice.
--

John W. Vinson [MVP]