Solved

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

Posted on 2014-09-12
3
562 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
  • 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now