While that will work, it has the annoyance that it'll pop up a message
asking whether you really wanted to insert the values.
Perhaps better is
'=========
Dim strSQL As String
strSQL = "INSERT INTO TableName (Field1, Field2) values(1,'Hello World')"
CurrentDb.Execute strSQL, dbFailOnError
'=========
Not only does this suppress the messages, but it also allows you trap any
errors that might occur.
--
Doug Steele, Microsoft Access MVP
Hi,
something similar to the following should point you in the
right direction:
'=========
Dim strSQL As String
strSQL = "INSERT INTO TableName (Field1, Field2) values
(1,'Hello World')"
DoCmd.RunSQL strSQL
'=========
hth
chas