Unable to debug at all! Help !

  • Thread starter Alexcamp via AccessMonster.com
  • Start date
A

Alexcamp via AccessMonster.com

As I program my forms I used to rely a lot on the step-by-step debugging (F8
key). For some reason, I can get it to work here.

When I press F8 I get a dumb tone and nothing happens.
When I place my cursor somewhere in the sub and use the CTRL-F8 key, still
get a dumb tone and nothing happens.

The same behavior occurs if I use the debugging menu instead of the keys.
It has nothing to do with the "use special keys" checkbox.

Also, another strange behavior (probably related) is when I press the run
button (the one that looks like a "play" button), instead of running the sub
it will open the "macro" window (the same one that opens when you go to Tools
--> Macro in the menus).

So, can anyone tell me what the hell is going on ?

I just created a brand new database with a little Form with a command button
and a text box. here's the code I am trying:

Private Sub Command0_Click()

Dim myText As String
myText = Me.Texte1.Value
Message = MsgBox(myText, vbOKOnly)

End Sub

simple enough. but I can't even debug this one.
If I press the command button on the form it runs fine.
Also, If I leave the textbox empty the code will pause because of a Null
value, and from there I am able to do stepbystep debugging.

I would like to add that this happens in EVERY database I have here.

any help will be greatly appreciated!!!!
 
A

Alexcamp via AccessMonster.com

I would like to ass that I DO place my cursor after the Dim statements, when
I try everything listed above.

Thanks
 
A

Alexcamp via AccessMonster.com

oops... typo! Make that "I would like to ADD that I do place my cursor...."
 
G

Graham Mandeno

Hi Alex

Unless you are already at a breakpoint, you cannot directly run (F5) or step
into (F8) a procedure, unless it:
a) is in a standard module
b) is public
c) has no arguments

Your Command0_Click procedure below fails the first two conditions.

What you should do is set a breakpoint (F9 or click in the margin next to
the required line) and then run the code by opening the form and clicking
the button. Your code will then stop at the breakpoint and THEN you can
step or run or examine variables as required.
 

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