Cannot open any more databases

J

James Martin

I have a routine which cycles through records from a table and, for each
record, temporarily opens a form which does some processing on that record.
Then, it closes that form and repeats the whole procedure for the next
record.

So, the routine has a couple lines like this:

DoCmd.OpenForm "frmUpdateCustomerHistory", , , "CustomerIDr='" &
CustomerID & "'"
DoCmd.Close acForm, "frmUpdateCustomerHistory"

When I run this, it works fine for 30 records and then gives me:

Run-time error '3048':
Cannot open any more databases.

The original routine has the table open with DAO so that it can cycle
through the lots. It only opens the table once. The logic is:

Open table
For each lot
Open update form
Close update form
Loop
Close table

The update form doesn't use ADO or DAO.

Any idea why I'm getting this error? Help would be greatly appreciated.

Thanks in advance,

James
 
J

Jeff Boyce

James

Is there a reason you could not to do the updating in code, rather than
opening and closing the form?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

James Martin

Hi Jeff,

If necessary I could rewrite it without the need for the form. But utilizing
the built-in functions of the form is saving me a lot of coding.

James
 

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