I've looked into this a bit, and it seems that reflection might be the necessary tactic to accomplish what I'm trying to do, but it's confusing as all get out to me for some reason. Looking for a little help with my specific situation.
I'm building a reporting dashboard. I have a combobox populated with a list of clients. When a user selects a client, it needs to populate a second combobox with the reports unique to that client. As an added requirement, in order to add clients easily in the future, they want separate modules with the code for each client. That way they can copy and paste from one module into a new one and customize it for that client without having to make massive changes to the rest of the application.
So...there are modules like client1.vb, client2.vb, and within those modules will be identically named functions or I guess subroutines. For instance, each client would have a function called loadReports() (not totally sure if I can even have multiple methods in different modules named the same thing??) that would get the necessary reports for that specific client and populate the second combobox with the reports.
What I want to do is this: user selects client from combobox, application takes combobox1.selecteditem and stores it to a variable. We'll call the variable "selectedClient". I then want to be able to in essence use the string value of that variable to call the necessary module and method. So it would be selectedClient.loadReports(), where selectedClient = "client1" or whatever.
I'm not sure if that makes sense or not, but I'm just wondering if there's an easier way to do this than with reflection, and either way, how would I accomplish it?
I'm building a reporting dashboard. I have a combobox populated with a list of clients. When a user selects a client, it needs to populate a second combobox with the reports unique to that client. As an added requirement, in order to add clients easily in the future, they want separate modules with the code for each client. That way they can copy and paste from one module into a new one and customize it for that client without having to make massive changes to the rest of the application.
So...there are modules like client1.vb, client2.vb, and within those modules will be identically named functions or I guess subroutines. For instance, each client would have a function called loadReports() (not totally sure if I can even have multiple methods in different modules named the same thing??) that would get the necessary reports for that specific client and populate the second combobox with the reports.
What I want to do is this: user selects client from combobox, application takes combobox1.selecteditem and stores it to a variable. We'll call the variable "selectedClient". I then want to be able to in essence use the string value of that variable to call the necessary module and method. So it would be selectedClient.loadReports(), where selectedClient = "client1" or whatever.
I'm not sure if that makes sense or not, but I'm just wondering if there's an easier way to do this than with reflection, and either way, how would I accomplish it?