A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Add new record through Form view



 
 
Thread Tools Display Modes
  #1  
Old December 26th, 2009, 07:11 PM posted to microsoft.public.access.forms
Ranjith Kurian[_2_]
external usenet poster
 
Posts: 31
Default Add new record through Form view

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.
  #2  
Old December 26th, 2009, 07:27 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Add new record through Form view

On Sat, 26 Dec 2009 11:11:01 -0800, Ranjith Kurian
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]
  #3  
Old December 27th, 2009, 05:38 AM posted to microsoft.public.access.forms
Ranjith Kurian[_2_]
external usenet poster
 
Posts: 31
Default Add new record through Form view

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
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]
.

  #4  
Old December 27th, 2009, 05:56 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Add new record through Form view

On Sat, 26 Dec 2009 21:38:01 -0800, Ranjith Kurian
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]
  #5  
Old February 9th, 2010, 06:43 PM posted to microsoft.public.access.forms
Frank[_26_]
external usenet poster
 
Posts: 13
Default Add new record through Form view

On Dec 26 2009, 9:38*pm, Ranjith Kurian
wrote:
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
wrote:


I have a table which is linked to a form, i would like to have a command
button which willaddanewrecord 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]
.- Hide quoted text -


- Show quoted text -


John,

When I used the code above, I got Run_time error ' 2105' : You can't
go to specified record. Any idea?

Thanks

Frank
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:33 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.