F5 to Step Through brings up Module List (1 Viewer)

GK in the UK

Registered User.
Local time
Today, 15:14
Joined
Dec 20, 2017
Messages
274
Trying to step through some code using F5 and it brings up a Macros window. This didn't use to happen. There's a list of procedures, all Public. Just 3 of them are from my own code, but the list seems arbitrary. For example, one of my code modules has 3 Public subs but just 2 of them appear in the list.

Is this normal ? How do I step through my code without this window coming up ?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:14
Joined
May 7, 2009
Messages
19,242
you need to be in VBA first, and inside a sub/funtion before you press F5.
otherwise you will get the window prompt to select which code to run.
 

Gasman

Enthusiastic Amateur
Local time
Today, 15:14
Joined
Sep 21, 2011
Messages
14,288
F5 will just run the code as well? Unless you have put some breakpoints in, you will see nothing.
I tend to use F8 to step through code if I have not set any breakpoints, which I can do anyway afterwards, and then use F5.
 

GK in the UK

Registered User.
Local time
Today, 15:14
Joined
Dec 20, 2017
Messages
274
Oh yes, sorry, I have set a breakpoint. Still trying to debug my other issue. So I open the form where I have the breakpoint, the code window opens with the line highlighted yellow, I press F5, the Macro window opens. I want to keep stepping through.
 

Gasman

Enthusiastic Amateur
Local time
Today, 15:14
Joined
Sep 21, 2011
Messages
14,288
What happens with F8 ?
 

GK in the UK

Registered User.
Local time
Today, 15:14
Joined
Dec 20, 2017
Messages
274
Ah that works. I could have sworn I used F5 before. Thanks. The forward arrow 'Step Through F5' brings up the Macro dialog but I'll just use F8.

Part 2, why do I have this Macro list ? I don't know how to design a Macro. How did the Public subs get in there ?

I'm trying to be sure that I haven't got some other underlying issue with my code or application whilst trying to fix my focus/KeyUp problem.
 

Gasman

Enthusiastic Amateur
Local time
Today, 15:14
Joined
Sep 21, 2011
Messages
14,288
F5 should work fine if you are in the code window?
I get Macroes, if I am in the immediate window with F5. Not something I have ever tried before?
I get nothing if in a form?

I think it is a carry over form Excel where VBA code is called macroes. A lot of new users also call VBA macroes, now I can see why. :)
 

GK in the UK

Registered User.
Local time
Today, 15:14
Joined
Dec 20, 2017
Messages
274
It says F5 Run Sub/User Form so I must be having a senior moment, I must have used F8 before. Question about the Macros still stands though.
 

GK in the UK

Registered User.
Local time
Today, 15:14
Joined
Dec 20, 2017
Messages
274
So ... just to be sure, the list of Macros, which seems to be an arbitrary list of Public subs, isn't an issue ? It's just I can't see why some of those subs are in there when others aren't. I've never written a Macro to my knowledge. I've only ever used Access 2016. I have a module called mod_ControlState, it has 3 public subs, all my code, and two of them appear in the Macro window. I wonder why they're in there, and I wonder why only 2 are in there.
 

Users who are viewing this thread

Top Bottom