?
Solved

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

Posted on 2014-09-12
3
Medium Priority
?
578 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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…
Suggested Courses

770 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