Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 6th, 2003, 11:13 AM
Registered User
Join Date: Jun 2003
Location: Columbia, MD, USA.
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?

Reply With Quote
  #2 (permalink)  
Old August 6th, 2003, 11:34 AM
Authorized User
Join Date: Jun 2003
Location: Memphis, TN, USA.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts

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.

Reply With Quote
  #3 (permalink)  
Old August 6th, 2003, 03:21 PM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
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


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:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #4 (permalink)  
Old August 7th, 2003, 02:51 AM
Authorized User
Join Date: Jul 2003
Location: Stockton on Tees, , United Kingdom.
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts

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
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 10:14 AM.

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