mbolen
mbolen

Reputation: 23

Macro not working without VBA Editor open

In one of my forms in my Access Database I have a button with a Macro Event that opens another form where two fields match. However, whenever I open my Database this button with the Macro Event doesn't work until I've opened the VBA Editor. After I've opened the VBA Editor and refreshed the form it works just fine.

Also, the Conditional Formatting that I've attached to one of my text boxes on this form (same form as button with Macro Event) doesn't work unless the VBA Editor is open either..

Any thoughts?

Just to clarify, after the VBA editor is closed the code works as well, it seems as if it just needs that initial opening. I have other VBA and Macro events that work without the VBA editor needing to be opened, like I said it’s just that conditional formatting and that specific macro event on my button. When I’m back at work on Monday I’ll provide more details when it comes to the code and etc.

Solved: So the code must have disabled, although there was no yellow bar indicating this was the case. I made a copy of my database to troubleshoot and when I opened the my new copy it asked me to enable code and now everything works fine.

Upvotes: 1

Views: 406

Answers (1)

Edgar
Edgar

Reputation: 2787

Strange. I suggest you create an AUTOEXEC macro and run a function with something simple like just showing a message box in VBA. With that you can verify if your code is the problem or something else.

Upvotes: 1

Related Questions