Eljefegeneo
Still trying to learn
- Local time
- Today, 14:09
- Joined
- Jan 10, 2011
- Messages
- 904
This is a re-post of one of a few days ago that seems to have gone down a black hole. It was either inadvertently lost or deleted, but here it is again.
What I am trying to do is avoid repeating a long line of VBA code that is used on five or six forms. I have it on the forms' OnCurrent event and on a control named [Country], the AfterUpdate event. One of the various address controls on the form and its label is either visible or not visible depending on what is in the [Country] control.
I am not sure if I should be using a function of public sub, but previous replies to the old post said public sub. But when I try to call the sub all kinds of bad things happen.
Attached is an updated sample database of what I was attempting. frmMain has the code in the events and it works fine. frmMain1 and frmMain2 were my two attempts at trying to use a module to do the same thing.
Any help you can give me would be greatly appreciated.
What I am trying to do is avoid repeating a long line of VBA code that is used on five or six forms. I have it on the forms' OnCurrent event and on a control named [Country], the AfterUpdate event. One of the various address controls on the form and its label is either visible or not visible depending on what is in the [Country] control.
I am not sure if I should be using a function of public sub, but previous replies to the old post said public sub. But when I try to call the sub all kinds of bad things happen.
Attached is an updated sample database of what I was attempting. frmMain has the code in the events and it works fine. frmMain1 and frmMain2 were my two attempts at trying to use a module to do the same thing.
Any help you can give me would be greatly appreciated.