SQL

  • Thread starter Thread starter Miranda
  • Start date Start date
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
 
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
 
Back
Top