INSERT INTO Part 2

  • Thread starter RedHeadedMonster via AccessMonster.com
  • Start date
R

RedHeadedMonster via AccessMonster.com

After messing with it, got the following to work:

Dim SQL As String

If CDRLID = 9 Or CDRLID = 10 Then
DoCmd.SetWarnings (0)
SQL = "INSERT INTO Notifier (ID, NameID) VALUES (ID,37)"
DoCmd.RunSQL SQL

Else
End If

NEW QUESTION I want to Insert 2 rows, one where Values (Id, 37) and the
other (id, 25)

When I use the following:

SQL = "INSERT INTO Notifier (ID, NameID) VALUES (ID,37),(ID,25)"

it tells me Im missing a semi colon at end of statement...so I use

SQL = "INSERT INTO Notifier (ID, NameID) VALUES (ID,37),(ID,25);"

and it still insists that Im not using a semi-colon at the end of the SQL
statement........
*frustration* its making me NUTS
Any suggestions?

RHM
 
J

J_Goddard via AccessMonster.com

Hi -

Insert Into .... Values( ....) can only insert one record at a time. You
will need two Insert statements to do what you need.

John
 

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