Converted Access 2003 database loop

M

Marie

Recently converted an Access 97 database to Access 2003. Moved the database
from a Windows NT server to a SAN. All was well. Twice in the last 6 months
strange event occurred. A basic VB Do While loop that inserts records into a
table went crazy! First time inserted 2000+ records instead of 1. Recently,
inserted 14000+ records instead of 1. This specific loop runs at least 50
times a day, 7 days a week. Yet, happened twice. Cannot duplicate the
results.

Has anyone ever seen this?

Thanks!
 
M

Marie

Sure..
i = 1


Do Until i > [Forms]![frmEnterNumb]![Numb]

DoCmd.OpenQuery "qryAddressInsert"
DoCmd.OpenQuery "qryAddressUpdate"

i = i + 1
Loop

where qryAddress Insert is insert a record to the Address table and
qryAddressUpdate is adding a name to the record. The majority of the time
users enter "1" on frmEneterNumb.Numb. Occasionally, they will enter "2".
If they leave it blank, "1" is the default. This ran for some reason 14,438
times last week. There is only room on the form to enter 1 digit.
 
S

strive4peace

Hi Marie,

what is the SQL for each of the queries you are running?
(open query in design view, then, from the menu --> View, SQL)

Warm Regards,
Crystal

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*



Sure..
i = 1


Do Until i > [Forms]![frmEnterNumb]![Numb]

DoCmd.OpenQuery "qryAddressInsert"
DoCmd.OpenQuery "qryAddressUpdate"

i = i + 1
Loop

where qryAddress Insert is insert a record to the Address table and
qryAddressUpdate is adding a name to the record. The majority of the time
users enter "1" on frmEneterNumb.Numb. Occasionally, they will enter "2".
If they leave it blank, "1" is the default. This ran for some reason 14,438
times last week. There is only room on the form to enter 1 digit.

strive4peace said:
Hi Marie,

can you please post the code you are running?


Warm Regards,
Crystal

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 

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