Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 6th, 2003, 11:13 AM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Programmatical Update?


Hello All,
I have a form that I allow additions on.
From the very beginning, I have been able to use the record navigation buttons on the bottom left to go to the end of the recordset, go one beyond and type stuff (where a new record is automatically inserted).
Then, to "save" this record, the only way I discovered was to use the record navigatino buttons again to move to another record, then move back to verify it was added.
So what I'm looking for, here, is a way to programmatically "save" the inserted record without having to navigate to another record. I've tried using the "RecordSet.Update" method, but it complains about there not being a previous "AddNew" or "Edit".
I cannot turn off "AllowAdditions" on the form for reasons I won't go into here.
Anyone give me a clue?

Thanks,
-Mike
 
Old August 6th, 2003, 11:34 AM
Authorized User
 
Join Date: Jun 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Why not have a button that turns "Allow Additions" to true, based on the user keing in a password. Thus you have the best of both words, security and access.

John
 
Old August 6th, 2003, 03:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Mike,

On your form's design view, make sure the Wizards button is toggled ON an then put a new command button on your form. That will activate the Wizard. It will guide you into putting a button on the form that will save the data. When you do that and view the code behind it, you should see something like this on the button's ON CLICK event:
Code:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old August 7th, 2003, 02:51 AM
Authorized User
 
Join Date: Jul 2003
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You could try adding a button called 'Save this Record' to the form and set an On_click event for it with this coding:

DoCmd.RunCommand acCmdSaveRecord

which runs the menu command 'Save Record.

Hope this helps

Cheers Ray





Similar Threads
Thread Thread Starter Forum Replies Last Post
update multiple columns in an update statement debbiecoates SQL Server 2000 1 August 17th, 2008 04:01 AM
Programmatical "Pick-n-Play" for MP3 oldmainframehack VBScript 0 June 18th, 2008 03:00 PM
Update link doesn't update in FormsView shaly ASP.NET 2.0 Basics 0 December 6th, 2006 04:33 PM
Datagrid.update() and DataAdapter.Update aarunlal ASP.NET 2.0 Professional 2 February 23rd, 2006 11:41 PM
Programmatical Update? mkaufman Access VBA 1 August 6th, 2003 11:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.