Hi!
I have a form which displays company data. I have a few continuous subforms within a tab control. One of them displays employees working for that company. Now in the employee table I have a EndDate field. This field represents whether the employee is active (Null value) or non-active (date of deactivation).
What I'm trying to do is instead of displaying that EndDate on the employee subform I wish to put a text box there in detail section of the subform that displays whether the employee is active or not ("yes" or "no" based on the EndDate value). Something like
If IsNull(Me.EndDate) = True (False) Then Me.txtActive = "Yes" ("No")
Now all Ive done so far is display the active status of the first employee in the subform, where all other employees get the same status. For example, if the employee in the first row has an EndDate it will display active = "No" for all the employees in that company.
I appreciate any suggestions on how to make this work. I'm guessing either my code is missing something or I'm not sure under which event to put it. Or both. Now that I think about it - would this require looping through a recordset? Am I better off just adding another field for activity status to the employee table?
I have a form which displays company data. I have a few continuous subforms within a tab control. One of them displays employees working for that company. Now in the employee table I have a EndDate field. This field represents whether the employee is active (Null value) or non-active (date of deactivation).
What I'm trying to do is instead of displaying that EndDate on the employee subform I wish to put a text box there in detail section of the subform that displays whether the employee is active or not ("yes" or "no" based on the EndDate value). Something like
If IsNull(Me.EndDate) = True (False) Then Me.txtActive = "Yes" ("No")
Now all Ive done so far is display the active status of the first employee in the subform, where all other employees get the same status. For example, if the employee in the first row has an EndDate it will display active = "No" for all the employees in that company.
I appreciate any suggestions on how to make this work. I'm guessing either my code is missing something or I'm not sure under which event to put it. Or both. Now that I think about it - would this require looping through a recordset? Am I better off just adding another field for activity status to the employee table?
Last edited: