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!

Problem using VBA to Insert records

Status
Not open for further replies.

laffspotpc

IS-IT--Management
Jan 31, 2003
3
0
0
US
I'm using a form to input data for one table, but I also need that data to go into a different table (for which I'm using VBA). It works for the most part, but every once in a while it doesn't insert the record into the second table.

The code is in the AfterInsert event of the form, and it never gives any error messages. But out of every 25 records it inserts, one or two of them do not make it to the second table (they do go into the main table the form is for).

So I'm wondering if anyone has had a problem like this before and could tell me what I'm doing wrong, or if there might be a better way to do this.
 
In the code behind the event, you could conceivably be using the same recordset object for the two unique tables.
Dim two separate recordset objects, one for each table, and at the end of the routine, set each one to nothing.

HTH,

Neal Miller
Miller Systems, Inc.
708-479-0085 Neal Miller
President
Miller Systems, Inc.
(708) 479-0085
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top