So from what I can see of your code, the issue is what I was hinting at before
Unless you have this line:
then your boolean is only local to the specific function. So it is actually two different instances of a boolean variable called ARRIVAL, one in each of your subs.
If my understanding is correct, then there are a couple ways to fix it. You can put in the above line of code, or similarly:
-Either of these two lines would work, but they need to be placed outside your sub
With either of these lines, your Check_ARRIVAL_Code function will set the ARRIVAL to true or false, and then the btn sub would check the value of that variable. If you want to implement this, make sure you get rid of the dim ARRIVAL as Boolean line because this will create a local instance and ignore the global.
The alternate fix, and maybe the better one depending on the rest of your code, is to have your function return the true or false value, rather than setting a variable. Your code would then look like this:
Let me know if this helps.
Bookmarks