Advertisement

10.24.2007 at 12:41AM PDT, ID: 22913953
[x]
Attachment Details

Access 2007 VBA code to save data entered into a form

Asked by murbro in Microsoft Access Database, Access Forms

Tags: access, save, vba, data, form

Hi

I have a simple Access form with a button that creates a new record.
There is however no btton to save the entries made to the table.
What VBA code would I use to commit the data to the table
and what measures would I need to stop the data from automatically being saved to the table
without clicking the buton
I used the following code which seemed to work but am not sure exactly what it does
   On Error GoTo ErrN
 
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

    Exit Sub

ErrN:
    MsgBox Err.Description
    MsgBox ("There was a problem saving this record!")Start Free Trial
[+][-]10.24.2007 at 02:38AM PDT, ID: 20137371

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.24.2007 at 02:47AM PDT, ID: 20137409

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Access Database, Access Forms
Tags: access, save, vba, data, form
Sign Up Now!
Solution Provided By: peter57r
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628