Solved

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

Posted on 2014-09-12
3
565 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.

Question has a verified solution.

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

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

911 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

23 Experts available now in Live!

Get 1:1 Help Now