Solved

MS Access 2010 VBA Syntax to Insert Row in Button on click method

Posted on 2014-09-12
3
572 Views
Last Modified: 2014-09-12
I need to insert a row to a table.

Private Sub btnSaveFeature_Click()

Dim strInsertSQL As String


strInsertSQL = "INSERT INTO tblFeature (Cat_No, Fea_ID, Fea_Name)
VALUES ( 120, '6.1.1', 'NA')"

What is the syntax to run this SQL Statement?

Thanks
0
Comment
Question by:Dovberman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40319460
Dim strInsertSQL As String


strInsertSQL = "INSERT INTO tblFeature (Cat_No, Fea_ID, Fea_Name)
VALUES ( 120, '6.1.1', 'NA')"
Currentdb.Execute strInsertSQL
0
 

Author Comment

by:Dovberman
ID: 40319563
Perfect.

Thanks
0
 

Author Closing Comment

by:Dovberman
ID: 40319564
Perfect. Thanks,
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question