I have several forms that all have the same textbox & flexgrid on them. They all contain the exact same data and I want them to work exactly the same way on every form. They are basically fancy combo-boxes. You start typing in the textbox and the grid becomes visible and displays a list of choices. Then selecting a choice on the grid will populate the textbox with the selection and make the grid disappear.
Right now, I have the code for this in the Events and Subs in each form's code. However, this means if I want to make a change it all works, I have to make the change on every form which is a huge pain and it is easy to make mistakes and miss something.
I would like to have a common module that all of the forms use so I can change the code in one place and have it effect all of the forms. All of the text-boxes and grids have the same names on every form.
I've tried creating Public Subs in a module, but I can't figure out how to do this. I receive errors saying that the "Variable is not defined" when I reference the textbox name. I've tried passing the form name into the Sub, but can't get this to work either. My usual web searches haven't turned up anything. Can anyone point me in the right direction? Thanks!
Right now, I have the code for this in the Events and Subs in each form's code. However, this means if I want to make a change it all works, I have to make the change on every form which is a huge pain and it is easy to make mistakes and miss something.
I would like to have a common module that all of the forms use so I can change the code in one place and have it effect all of the forms. All of the text-boxes and grids have the same names on every form.
I've tried creating Public Subs in a module, but I can't figure out how to do this. I receive errors saying that the "Variable is not defined" when I reference the textbox name. I've tried passing the form name into the Sub, but can't get this to work either. My usual web searches haven't turned up anything. Can anyone point me in the right direction? Thanks!