G
Guest
I have an module processes to inport records from a text file. If the record
passes certain criteria the module adds the record to a master table. The
last criteria is they cannot already be in the master table. I have keys
setup and all but the criterias are more intense then just a key.
So just before I do an install I do a DCOUNT to see if there is an existing
record. If the count is 0 then I run a DoCmd.RunSQL to insert the new record.
Everything works fine until the network is slow and the same person is in
the import file twice.
The first DoCmd Insert runs and inserts the record.
But then the next record still returns a count of 0 even thought a record
was just added. So it adds a second master record.
Is there a way to put a transaction around a DoCmd?
Or to force the table update to complete before I loop back for a next imput
record?
Would I be better off to use the CurrentDB.Execute instead of the
DoCmd.RunSQL?
Thanks,
Randy
passes certain criteria the module adds the record to a master table. The
last criteria is they cannot already be in the master table. I have keys
setup and all but the criterias are more intense then just a key.
So just before I do an install I do a DCOUNT to see if there is an existing
record. If the count is 0 then I run a DoCmd.RunSQL to insert the new record.
Everything works fine until the network is slow and the same person is in
the import file twice.
The first DoCmd Insert runs and inserts the record.
But then the next record still returns a count of 0 even thought a record
was just added. So it adds a second master record.
Is there a way to put a transaction around a DoCmd?
Or to force the table update to complete before I loop back for a next imput
record?
Would I be better off to use the CurrentDB.Execute instead of the
DoCmd.RunSQL?
Thanks,
Randy