SQL

M

Miranda

hi,

could someone tell me the easiest way to do an INSERT INTO
statement...macro? VB? i know how to write such an SQL statement but am
unsure of the syntax and how and where to write this statement. I want it to
be performed on a click event

any help would be appreciated
 
D

Dan Artuso

Hi,
Simple example:

This code would go in your button's click event.

Dim db As DAO.Database
Dim strSql As String

Set db = CurrentDb()
strSql = "Insert Into yourTable (field1,field2) Values ('hi','there')

db.Execute strSql, dbFailOnError

Set db = Nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top