Set db = CurrentDb Hangup

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using a combo box AfterUpdate event to add a new product to a customer
profile. If I open Access and try to do the "Add Product" process first
thing, the debugger hangs up at the "Set db = CurrentDb" command. If I reset
the debugger and try again (or do anything else, it seems, in Access), the
process runs properly.

How can I keep the debugger from hanging me up in this case? Thanks.

Bill Schaupp
 
Do you have a reference to the DAO library?
Do you require explicit declarations of variables (using Option Explicit)?

- Turtle
 
MacDermott, Thanks for your response. I'm not sure what you mean about a
reference to the DAO library. My only statements concerning the DAO library
and connections are:

Dim db As DAO.Database
Dim cn As ADODB.Connection
Set db = CurrentDb
Set cn = CurrentProject.Connection

I am using Option Explicit.

Are these statements adequate? Or should I be using something else.

The problem may have taken care of itself somehow. I have not had a
debugger hangup since sending this help request.

Thanks again.

Bill Schaupp
 
With your code open, click Tools - References.
You should see a References Dialog.
Make sure that Microsoft DAO Library is checked.

If it is, you might try this procedure:
Remove the check.
Close the dialog using OK (not the x in the upper right).
Reopen the dialog.
Recheck the item.

HTH
- Turtle
 
Bill said:
MacDermott, Thanks for your response. I'm not sure what you mean
about a reference to the DAO library. My only statements concerning
the DAO library and connections are:

Dim db As DAO.Database
Dim cn As ADODB.Connection
Set db = CurrentDb
Set cn = CurrentProject.Connection

It seems a bit unusual to me, though not unheard of by any means, that
you are using both DAO and ADO object to accomplish your ends. Do these
statements all come from the same procedure? Would you be interested in
posting the whole procedure, in case there's someunnecessary or
erroneous code in it?
 
Back
Top