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.
0
Utf
12/26/2009 7:11:01 PM
access.forms 6864 articles. 2 followers. Follow

4 Replies
3226 Views

Similar Articles

[PageSpeed] 51

On Sat, 26 Dec 2009 11:11:01 -0800, Ranjith Kurian
<RanjithKurian@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]
0
John
12/26/2009 7:27:34 PM
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@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]
> .
> 
0
Utf
12/27/2009 5:38:01 AM
On Sat, 26 Dec 2009 21:38:01 -0800, Ranjith Kurian
<RanjithKurian@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]
0
John
12/27/2009 5:56:57 AM
On Dec 26 2009, 9:38=A0pm, Ranjith Kurian
<RanjithKur...@discussions.microsoft.com> 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
> > <RanjithKur...@discussions.microsoft.com> wrote:
>
> > >I have a table which is linked to a form, i would like to have a comma=
nd
> > >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.
> > --
>
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0John 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
0
Frank
2/9/2010 6:43:17 PM
Reply:

Similar Artilces:

Publisher Pic Problems & VGA Driver
Hi, I'm very frustrated. I too cannot see any embedded photos when I open up my Publisher doc for editing. Tried everything in Help & now have read everything in the Online Support. (Btw, I'm not absolutely positive but I think this "invisible pics" problem started happening after I downloaded Flash 8, as a last resort I will uninstall it). Anyway, I have an Asus W5A laptop with Windows XP Pro. It has Intel Centrino Mobile which includes an Intel (R) 915/GM Chipset driver. So following suggestions on this site, I went to the Intel to find driver downloads to upd...

referencing to worksheet names in macro for each new worksheet inserted
Hi I created a code to insert new worksheets and rename them according t values on the new worksheet itself. Say in Cell D1, i have th worksheet name. My question is when i want to refer to this worksheet in subsequen coding, how should i code it? For eg, How should i write the ???? for Sheets("????").select? Would creatin the a variable to store the names help? Thanks in advance Ken -- Message posted from http://www.ExcelForum.com After inserting your new worksheet set it's name equal to a variable. For example SHEETS.ADD VWORKSHEET = ACTIVESHEET.NAME This method ...

Updating a table from Form Entry
I have a form that pops up when a user clicks a button to Print said form. The form is for the user to enter the name of the table and any footnotes for that particular form, this form is connected to a table that stores this information for everytime the report is printed. THe problem I having is that when the user enters the information and clicks [PRINT] the report is blank, when I open the table the info the user has entered has not updated onto the table yet. Is there a way so that when the user clicks [PRINT] the footnote table will update BEFORE the report prints? Larry -- Neve...

Update textbox on form
The following are events on two combo boxes on a subform "NewJobsSubform", the first sets the rowsource of the second and also sets a default value in the second. The second event sets the value in the text box "Sell" to the price associated with the RepProduct in cboRepProduct - collected from the table "RepairProducts". "Private Sub cboCatName_AfterUpdate() On Error Resume Next Me.cboRepProduct.RowSource = "SELECT RepairProduct.RepProduct FROM" & _ " RepairProduct WHERE CatName = '" & Me.cboCatName.Value...

Forms Based Authentication
I have configured Exchange 2003 Server on Windows 2003 Server. Everything works , HTTP,HTTPS, OWA Password change , but whenever I enable forms based authentication I recieve an error "440 login timeout" and the page will not load. Pls Help Regards I hesitate, because it doesn't fully match your diagnosis but take a look at: http://support.microsoft.com/default.aspx?scid=kb;en- us;817379 to see if it's of any help. >-----Original Message----- >I have configured Exchange 2003 Server on Windows 2003 Server. Everything >works , HTTP,HTTPS, OWA Password change ,...

Where Can I Find The Icon For A New E-mail Message In Outlook?
I've created the shortcut "C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE" /c ipm.note for my Outlook to open a new message but it assigns the Outlook Icon... Thanks Assuming you are using an English version Outlook 2003, you might find what you are looking for at: \Program Files\Microsoft Office\OFFICE11\FORMS\1033 "Justern" <justern@hotmail.com> wrote in message news:4133cc19$0$27218$61ce578d@news.syd.swiftdsl.com.au... > I've created the shortcut "C:\Program Files\Microsoft > Office\OFFICE11\OUTLOOK.EXE" /c ipm.note for m...

How Do I Copy My Outlook Files To My New Computer?
I exported my Outlook files from my old computer and burned them to a CD. During the export process, it asked me three times for a password. When I tried to import these files to my new computer I got "File access is denied. You do not have the permission required to access the file." Can anyone help? Apart from the fact that Import/Export options often lead to corruption - you should use a simple pst copy - The pst needs to be on the hd and the read only flag off, before In OL attempting to open it. NB not import <aprice6@hotmail.com> wrote in message news:1145746658.84...

Viewing an Excel sheet w/out all the empty fields...
How do you create a spreadsheet that only shows the fileds with data in them? -How do you get rid of all the empty rows/columns, to ease viewing for those who are easily confused by excel spreadsheets? (I don't know how else to emaplin my question... I just don't want the extra columns & rows there, if that's possible...) Please help... Hi! >I just don't want the extra columns & rows there, if that's possible... Just hide them! Suppose the last column in your sheet that contains data is column H. You can hide columns I:IV so that after column H all you ...

viewing LN emails (.nsf files) saved to CD in outlook?
I have lotus notes messages saved on CD, these are saved as .nsf files. Is there any way I can view these in Outlook? have tried various LN websites - to no avail. ...

how to add singnature
"prasad" <prasad@discussions.microsoft.com> wrote in message news:5107796D-4E02-45AB-9816-47670410FA63@microsoft.com... > Please use the message body to provide information that will be invaluable in getting help. Things like: Version of Outlook. Type of mail server (exchange, pop/imap, hotmail). What you're trying to do (because, frankly, I could answer your question with 'You go to the end of your message and type it in' and be correct). What you've tried to do and how it failed. -- f.h. ...

How to view the code for excel built-in functions?
Is it possible? -For example the function PMT(). thanks. No, the code is compiled, so it would likely be less than useful anyway. About the best you can do is check out the equations used in Help (see "PV"). In article <OSU3OXOBGHA.1676@TK2MSFTNGP09.phx.gbl>, "serdar" <s@s.com> wrote: > Is it possible? -For example the function PMT(). > thanks. ...

View in new Portfolio Manager
Older portfolio manager had a view available which displayed by type of security. I am unable to find this option in the new portfolio manager. Am I missing something? Charlie On May 22, 9:57=A0pm, charlie <char...@discussions.microsoft.com> wrote: > Older portfolio manager had a view available which displayed by type of > security. =A0I am unable to find this option in the new portfolio manager= .. =A0Am > I missing something? > Charlie You didn't state which version of Money you are using but I'll attempt to answer. If you are using Money Plus, you can choos...

Automatically redirecting profiles to a new exchange server?
OK old exchange server was SERVEROLD and new one is SERVERNEW (for arguments sake). The pc has lots of different profiles on it and I dont wanna manually change each profile to reflect the new server. Running Outlook 2002 is there a way to automatically do this? I believe I can use a prf file created using Custom Wizards from the Office Resource Kit and deploy this to do this for me. Can anyone give any more detailed info on how this can be done? Thanks <carlosvenegas@jellybeandesign.co.uk> wrote in message news:1132785375.328184.274520@g47g2000cwa.googlegroups.com... > OK ol...

Please help with last formula for order form.
I am able to accomplish this with 1 column by the formulas below. Cell H160 is the subtotal: =IF(SUM(H72:H111)>0,SUM(H72:H111),"") Cell H166 the total: =IF(SUM(H160)>0,SUM((H160*H163)+H160),"") Cell H163 is for Tax. I am almost finished creating an order form. I would like to get the SUM of 3 different columns that are separated. I am not able auto fill strait down the column, because the information is separated in groups with titles, and the cells are not identically sized. I tried varations of this formula: =IF(SUM(H72:H111)+(116:131)+(135:154)>0,SUM ((H72:H...

Interactive web spreaadsheet viewing
I built an interactive speadsheet for the internet in Excel XP and it works and looks fine from my PC, but when I go to another PC that doesn't have Office XP on it, I get an error message that states I need some kind of component to properly view the spreadsheet. Is this something I can get and if so, will it run from the server or does it need to be offered as a download, plugin, or whatever? Any suggestions and/or help would be greatly appreciated. Thanks!!! ...

Setting default program for viewing pictures
How do I set the default program for viewing picture attachments? I use Outlook Express 6 and when I click to open an attached picture it opens to JASC Paint Shop Pro 8 but no picture appears. In the past Explorer opened up my pictures. Can any one give me the steps to change the default from paint Shop to Explorer?? Hi Digitdan, Change the program that starts when you open a file http://office.microsoft.com/assistance/preview.aspx?AssetID=HP051925951033&C TT=1&Origin=EC790000701033&QueryID=bSa5KrD4N0&Query=Change+the+program+that+ starts+when+you+open+a+file&Scop...

Automatically generate a new record
Can I autumatically generate a new record adding information (future date) from a current record? Yes. In your form have Double-click event call an append query that pull data from your form fields to append one record. INSERT INTO [YourTableToAppendInto] ( Field1, Field2, Field3, Field4 ) SELECT TOP 1 [Forms]![YourForm]![1stField] AS [X], [Forms]![YourForm]![2ndtField] AS [Y], [Forms]![YourForm]![2rdtField] AS [Z], [Forms]![YourForm]![4thtField] AS [A]; -- KARL DEWEY Build a little - Test a little "Crown Jenny" wrote: > Can I autumatically generate a new record addin...

How do I add multiple times together
Hi does anyone know how I can add multiple times togther and get the anser in hours and minutes. I have formatted the cell for time however when I atosum I keep getting an answer that is incorrect. Any help? Thanks D Maybe it was just a formatting problem. Try a custom format of: [hh]:mm Playhouse pm wrote: > > Hi does anyone know how I can add multiple times togther and get the anser in > hours and minutes. I have formatted the cell for time however when I atosum I > keep getting an answer that is incorrect. Any help? > Thanks > D -- Dave Peterson ...

will not let me add my hot mail e-mail
how do I add my msn hotmail email to out look "stephen2428" <stephen2428@discussions.microsoft.com> wrote in message news:101C02C3-519B-4B3C-8D8B-FABDCDEB9DE7@microsoft.com > how do I add my msn hotmail email to out look You can't unless you have a paid-for Premium Account. "stephen2428" <stephen2428@discussions.microsoft.com> wrote in message news:101C02C3-519B-4B3C-8D8B-FABDCDEB9DE7@microsoft.com... > how do I add my msn hotmail email to out look And we are supposed to guess as to WHICH version of Outlook that you use? HTTPmail got added fo...

Update Existing Purchase Orders with New Exchange Rate
Hello, I have existing Purchase Orders in Great Plains 8.0 were some of the line items have been received is there a way to change the exchange rate for the remaining line items and any new line items added? Thanks, Brian M. Database Administrator ...

Remove Add-Ins from Tools Menu
I installed an Add-In, used it an then uninstalled it. The Add-In still shows on the Tools menu. How do you get it off the menu? I exited and restarted the the program several times and the add-in is unchecked. Excel 2000, 9.04402 SR-1 Karl Does this add-in have a name? Some third-party applications are noted for sticking files in XLSTART. Visio comes to mind. Gord Dibben Excel MVP On Mon, 12 Jan 2004 16:31:17 GMT, "Karl Irvin" <88karl3200@comcast.net> wrote: >I installed an Add-In, used it an then uninstalled it. The Add-In still >shows on the Tools menu. How ...

can't find form
i have a command button on a form [frmMainMenu] that when clicked, closes that form and opens another [frmFixtureSchedulePrintOptions]. The 2 share the same table as a record source, so i'm doing this to avoid conflicting updates the code behind [frmMainMenu] reads like this (below), and functions correctly DoCmd.Close stDocName = "frmFixtureSchedulePrintOptions" DoCmd.OpenForm stDocName, acNormal on the new form [frmFixtureSchedulePrintOptions], there is a command button to save to close itself, and open the previous from [frmMainMenu], and the ...

Add a horizontal line to a graph but not to the legend
I want to be able to add horizontal lines to my chart, in this case at 4% and 6% on the y-axis. The solutions I've seen so far suggest to add a series at these points. The problem is that when I add a seires, my legend shows the new series when I don't really want them to. Is there a really simple way that I've overlooked so that I can just add a line at one y-value and all the x values on the graph and not have it appearing in the legend? Thanks I have just tested inserting an extra series in both xl2002 and xl2007 and if you select the legend and then select the indiv...

View both incoming/outgoing messages by Thread or Conversation ? #2
Is it possible to view messages in outlook 2003 by Thread or Conversation, both incoming and outgoing, in a single folder, or Inbox, just like Outlook Express News Reader. For example: + Sent Message + Received Reply +Sent Message or Replied + Received Reply I tried using Arrange by Conversation Option in outlook 2003 Inbox Folder, but its just showing Inbox Messages, not Sent Items Messages. Best Regards, Luqman ...

Form Summarys
I want to know if i can write up my form on excel and then on anothe sheet it summarizes it so i have a log of all the forms i send out bu each time i create a new form can it create a new summary underneat the old one ?? Many Thanks:D Ben -- Message posted from http://www.ExcelForum.com Does this mean that you have certain cells that you want to track? If yes, then you could run a macro when you're done with the form: Option Explicit Option Base 0 Sub testme01() Dim myCellAddresses As Variant Dim FormWks As Worksheet Dim LogWks As Worksheet Dim nextRow As Long D...