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!

Code stopping at non-existant Breakpoint 1

Status
Not open for further replies.

rfoye

Programmer
Oct 15, 2004
40
US
I have a module that is creating it's own breakpoint, and I can't figure out how to stop it.

The user fills in search fields on a form and clicks a button to launch the search procedure. The first part of the procedure sets variables and builds SQL strings for the search, and the code is stopping at Set db=CurrentDB

The code stops and presents the code window to the user. If I press F5, the code continues just fine.

I thought there was a "ghost" of a breakpoint that I had put in during debugging, and I've tried re-inserting a breakpoint, saving, deleting the breakpoint and saving. This has done nothing to eliminate the "ghost" breakpoint.

Can anyone help me?

I'm using Access2003 on an XP network.

-------------------
Rob Foye
Database Management
Regions Bank
 
How are ya rfoye . . .

Somewhere ahead of this [blue]Set db=CurrentDB[/blue] you should have:
Code:
[blue]   Dim db As DAO.Database 'if your using DAO
   Dim db As ADO.Database 'if your using ADO[/blue]
If your not sure try [blue]DAO[/blue] . . .

Calvin.gif
See Ya! . . . . . .
 
I have had this happen several times.... what works for me is to completely re-type the line of code on another line and delete the line that it stops on.

Then cannot remember if I do a compact and repair... cannot hurt to do it anyway.

Hope this helps.

John
 
I have had this happen several times.... what works for me is to completely re-type the line of code on another line and delete the line that it stops on.

Then cannot remember if I do a compact and repair... cannot hurt to do it anyway.

Hope this helps.

John
 
jmgaddis . . .

Was one of the lines I indicated in my prior post installed at the the time of the error?

Calvin.gif
See Ya! . . . . . .
 
Very possible AceMan1... Almost everytime it has happened, I had had a Breakpoint in that same area or line during the testing (do not always remember exact line Break Point was set on, just know that it stops very near or exactly on where I had the Break Point Set)

but... as you mention, I do believe that it is always related to coding involving recordsets...

I never use explicitly DAO.Database, usually just Dim dbs as Database, rst as Recordset.

Are you implying that the difference is the "DAO." part or that simply there should be a line of code prior to the "Set dbs = CurrentDB" such as Dim dbs as Database?

Thanks,
John
 
P.S.

I am assuming you mean to add the DAO. in front of Database... as I am sure if there wasn't any of that code above Set dbs = Currentdb it would produce an error.

I will try it the next time it happens.

Thanks again,
John
 
jmgaddis . . .

. . . and if you perform a compile?

Calvin.gif
See Ya! . . . . . .
 

Don't know that I remember to do a Compile... but will try it.

Doesn't happen enough to remember the steps... especially the odd part is that sometimes it doesn't happen on the database while I am running through the code... but after copying it to the PC that runs that MDB 24/7, will notice that it wasn't running and when switching over to that PC notice that it stops on a "non-existant" breakpoint.

now have some other ideas to try when it does happen.

Thanks,
John
 
By any chance do you have a Watch created for that variable, either to "Break when value is true" or "Break when value changes"?
 
jmgaddis' first suggestion worked perfectly. Thanks.

-------------------
Rob Foye
Database Management
Regions Bank
 
Thanks rfoye.

JoeAtWork... I never use the "Watch" feature, probably would if I took the time to learn to use it.

I believe it is simply Access getting confused during the many times of setting breakpoints and removing them... then possibly one thing that may cause it that I have caught myself doing, is closing out of the access database, with Breakpoints still set in Visual Basic, then copying the database over to another PC... may be whats happening to me when it does happen, maybe some confusion going on.

Thanks,
John
 
The Watch feature is useful when a variable is changing to a value it shouldn't be, you can set it to break at the line when the value hits a specific value (e.g. "x=99") or just whenever it changes. It lets you pinpoint the line of code that is setting the variable to the incorrect value.

But yeah, it looks like in this case it's just another case of Access flakiness.
 
The Date() function keeps giving the wrong date when used inside a subfunction. Typed into the immediate window it returns the correct date. Why this stubbern insistance on returning an inaccurate date?
 

Penrodcigar,
You need to start a new thread with your problem, not tag it on at the end of a totally unrelated posting!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top