animalcroc
animalcroc

Reputation: 293

difficulty tracing microsoft access VBA code

I'm new to access and am working with a database someone else wrote. I'm trying to understand the code by tracing it, but surprisingly I'm having trouble here.

There's a form, let's call it form 1, such that if you click it's "go" button it will execute a procedure. The first command in that procedure is:

DoCmd.OpenForm "Frm2", acNormal

When this line executes it goes to some module, "module X", where two functions are executed. These functions are in a stand-alone module and I don't see how they are related to Frm2. After these two functions are executed, control goes to Frm2, specifically this line in Frm2's code:

Form.Load

So, my question, as I alluded to earlier, is why are the two functions in module X called before control is handed to Frm2?

When the first of the two mystery functions are being executed, I do a stack trace and I see this:

function1()
<non-basic code>    
Frm1_Btn_click()

This doesn't tell me what's calling function1, and its throwing me off. If I comment out function1, I get a run-time error 3085 "Undefined Function function 1 in Expression". This begs the question, what "expression" is the error referring to? I believe this is the missing link, but I can't find it.

Thanks for your help

Upvotes: 0

Views: 709

Answers (1)

animalcroc
animalcroc

Reputation: 293

I solved it. The issue was a dependency that was caused by the form having a record source linked to a query. The was due to this.

I'm glad I was able to solve this!

Upvotes: 1

Related Questions