Debug: Play (>) SUB button doesn't work

Barbacuca

New member
Local time
Today, 17:01
Joined
May 13, 2009
Messages
9
Hello,

I have a small issue with my debug toolbar...

I'm in the VBA editor, the cursor is in the code window in the middle of a Sub. I click "Play" and out pops the "Macro" window asking me to name the Macro.....

In other words, the "Play" button doesn't run the code.

Can anyone help me how to debug the debug? :eek:

I don't understand why Play doesn't run the code.....

Cheers
 
Have you tried using the immediate window to run the sub or function?
 
Hello,

Thanks for the reply, but I still need to make use of the regular debug buttons. <Play> doesn't work as I would expect. As I click <Play> I get a window asking me for a macro name. If I do enter a new macro name, the editor immediately opens a new sub for that macro.

<Play> does not run the code. :(
 
I have never tried to start running code in a sub for function that way in over 15+ years of working with Access. It may work it there are no parameters to pass to the routine, but I am always passing something. A function usually return a value, so you need to call it by assigning the output to something which the "Play (>)" button ion the tool bar can't do. .

IMHO, it just does not seam logical to start code with the "Play (>)" button in Access.

I use the "Play (>)" button a lot. The only time I use the "Play (>)" button is to resume code that has been stopped in some way.
 
I have the same problem right now.... Access will not run any of the subs and to prove this, I had a macro that maximizes my form on load that I converted to VB and it doesnt work now. The Pause and Stop buttons are greyed out and none of my code works... :( Does anyone know how to enable this function, it's driving me crazy....
 
I think I figured this issue out myself (more or less....)

If your code is running in a class module, that is, code related to a form or report, then the <Play> button will not activate the code. You can only do that by initiating the action associated to that code, e.g, click a buttom for code conected to a rutine Button_Click().

The <Play> button *does* work if one runs code from a Standard module, available to the entire database.

What I don't know is why it happens that way...

Hope that helps.
 
Well that's retarded because I can get it to work fine if I create a new database. I don't want to have to use buttons to make hidden text boxes show up on the form, that defeats the purpose. The bottom line is that the VB code doesn't run and is totally useless right now. I know my code is correct because I tested it with 1 table and 1 form in a new db and it worked. Does someone have an answer to this problem?
 
Just to prove the VB code isn't running anymore, Current Time and Date show up as #name? on my form.
 
Baracuca, I think I found out what the problem could be.

I think there is a default setting when you create a new db form and create code in VBA that will allow you to run it the first time. Once you close and open it again, it blocks it.

I think you have to go programs>microsoft access> and click on the Office Button. There you have to go to the Trust Center and set your Trust Center Settings for Macros and other things like trusted zones where the code will be allowed to run. I don't know if this will fix your problem but I got my command buttons to work again. Now I have to see if the VBA code will work... :/
 
Yup, my VBA code is running now by fixing the Trust Center settings in Access. My txt fields are hidden and are visible when I select the appropriate value from my combo box. :D
 

Users who are viewing this thread

Back
Top Bottom