I have inherited a vb project and it's pretty disorganized and I'm trying to clean it up. The main issue is I need to change the all the references to the connect string used to call the database. The project has several sheets, 6 user forms, and 1 module. Most of the code is spread around inside the form code. The module has several public functions that are called from various places inside the form code. There are about 20 references to the database spread around all the form code. Usually there is a command button_click event that builds the connect string and calls the db (in 20+ places). The connect string is hardcoded in each reference. I want to reorganize this so that I can maybe have one variable for the connect string (security is not an issue as all of this is on a local db).
I'm not sure where to begin. I tried creating some global variables but kept getting the 'invalid outside procedure error'. I know it needs to be defined inside a standard module but when i did this(Public strconnTest As String) , says "invalid attribute inside procedure".
So I'm looking for help to get the code organized/centralized and assign a variable once for connect string
I'm not sure where to begin. I tried creating some global variables but kept getting the 'invalid outside procedure error'. I know it needs to be defined inside a standard module but when i did this(Public strconnTest As String) , says "invalid attribute inside procedure".
So I'm looking for help to get the code organized/centralized and assign a variable once for connect string