Replacement for rs.AddNew

  • Thread starter Thread starter Guest
  • Start date Start date
well, the general answer to such a generalized question is: don't open a
recordset. instead, use

CurrentDb.Execute <put Insert SQL statement here, as a string>, _
dbFailOnError

whether that will work in your specific situation is anyone's guess, since
we have no idea what those specific circumstances may be.

hth
 
You would have to build a SQL statement based on the table that the
record is being added to and the fields that are being set in any
subsequent records.

*HOWEVER* Why do you say that .AddNew is slow? What is the critiera that
you're using to make that statement? What is happing before & after the
statement in the code?
 
Thanks David:

It's based on timing of one hundred cycles of the statement.

Immediately before is the statement db.OpenRecordset( ) to open a table
of about 10,000 lines.

Regards,
Phil
 
Thanks Tina:

That works!

Now, I need to build the SQl statment "dynamically".

How do I pass a variable to the statement:

Insert into table x values ( I )

where I is a variable ?

Thanks,
Phil
 
just concatenate the variable into the string, as

"first part of string " & variable & " last part of string"

hth
 
Back
Top