Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

currentdb.openrecordset (Make new Record)

Status
Not open for further replies.

Blorf

Programmer
Dec 30, 2003
1,608
0
0
US
This is probably so simple that I can't figure it out, but...

I have a table that I want to create records in using VBA. I don't want to add records using docmd.runsql, because it is way too slow.

I can edit records and update them in VBA, but how in vba do I create a new record. I figured it would be something like .newrecord, but I get an error when I do that.

Thanks,
ChaZ

Ascii dumb question, get a dumb Ansi
 
Hi!

in your recordsetcoding, replace rs.edit with rs.addnew

Roy-Vidar
 
Thank you Very much. That change worked perfect.

One more quesiton if you don't mind though.

With Addnew and Edit, after the .update, does the record lock get released?

I ask because I have been scolded for locking up one of our servers with code by editing about 100000 records in VBA. The server shows the locks as active, even after the code terminated. I insisted that I had nothing to do with the server being upset, but secretly I wasn't sure.

Thanks,
ChaZ

Ascii dumb question, get a dumb Ansi
 
I haven't had the pleasure? of having to take such considerations for a while, (hope someone else pops in with more experience on that), but I think the lock is released after update.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top