Dear people of the Access forums,
Once more I call for help.
I thought that this current problem I have would have a simple solution that is easily found on the internet, but apparently I am wrong because google has no answer for me.
what is my problem?
every employee has an amount of assignments he/she is working on during one week. my form should be able to assign new tasks to the employee.
in practise:
if an employee for example has three assignments in week 21, there appear four combo boxes, three with the current assignments (with the possiblity to adjust them) and one empty to assign a new task.
by the way, this is not done dynamically but simply by turning premade comboboxes visible (I didn't had the patience to learn how to make them dynamically).
at any rate, this last empty combobox, when it has been used to assign a new task should automatically call an afterupdate event that will make a new empty combo box appear.
however, to do this, I have to assign the event only to the last empty combo box, but I don't manage.
I'm playing with this:
(5 being a random number, it could be any number)
which naturally doesn't work. so how is it done well?
I do have found a solution. Since all my combo boxes are premade, I just gave them all the same AfterUpdate event handler and with a global variable it works fine. However I just got my code cleaned up, and I want to keep it as efficient as possible
another smaller question: in many other object orientated languages, global variables are a blight upon a program, does that go as well for VB ?
Once more I call for help.
I thought that this current problem I have would have a simple solution that is easily found on the internet, but apparently I am wrong because google has no answer for me.
what is my problem?
every employee has an amount of assignments he/she is working on during one week. my form should be able to assign new tasks to the employee.
in practise:
if an employee for example has three assignments in week 21, there appear four combo boxes, three with the current assignments (with the possiblity to adjust them) and one empty to assign a new task.
by the way, this is not done dynamically but simply by turning premade comboboxes visible (I didn't had the patience to learn how to make them dynamically).
at any rate, this last empty combobox, when it has been used to assign a new task should automatically call an afterupdate event that will make a new empty combo box appear.
however, to do this, I have to assign the event only to the last empty combo box, but I don't manage.
I'm playing with this:
Code:
boxAssignment_5.AfterUpdate = Assignment_After_Update()
which naturally doesn't work. so how is it done well?
I do have found a solution. Since all my combo boxes are premade, I just gave them all the same AfterUpdate event handler and with a global variable it works fine. However I just got my code cleaned up, and I want to keep it as efficient as possible
another smaller question: in many other object orientated languages, global variables are a blight upon a program, does that go as well for VB ?