Greetings,
I am using Access 97, SR2.
I have a form that tracks developmental assignments of employees (frm_DNO_Developmental Assignments) . On this form I have a subform (sbfrmDevelopmentalAssignments). The subform is set to display continuous forms.
An employee can have more than one developmental assignment, but not at the same time. In other words, employee Jane Doe was on a developmental assignment that ran from 01 Jan 02 through 01 Feb 02. On 01 Mar 02 she began another developmental assignment that does not expire until 31 Aug 02. On the subform I have two date fields to enter the start and end dates of the assignment ([Start_Date] and [End_Date]). On the main form I have a field called DevAssgn. This is a text box that will display a Y or N (text value; this is not a true-false field). The control source for this field is also called DevAssgn.
I would like to have this field display a Y if an employee is on a current developmental assignment, regardless if any other assignment they have had in the past has expired.
Any ideas on how I might best accomplish this? Thank you in advance!
PS: Forgot to post the code I've tried to use.
Private Sub Form_Current()
Set the form Developmental Assignments to change the Dev Assgn box from Y to N if the Assignment
End_Date has expired.
If Forms![frm_DNO_Developmental Assignments]![sbfrmDevelopmentalAssignments]![End_Date] >= Date Then
Forms![frm_DNO_Developmental Assignments]![DevAssgn] = "Y"
Else Forms![frm_DNO_Developmental Assignments]![DevAssgn] = "N"
End If
End Sub
I am using Access 97, SR2.
I have a form that tracks developmental assignments of employees (frm_DNO_Developmental Assignments) . On this form I have a subform (sbfrmDevelopmentalAssignments). The subform is set to display continuous forms.
An employee can have more than one developmental assignment, but not at the same time. In other words, employee Jane Doe was on a developmental assignment that ran from 01 Jan 02 through 01 Feb 02. On 01 Mar 02 she began another developmental assignment that does not expire until 31 Aug 02. On the subform I have two date fields to enter the start and end dates of the assignment ([Start_Date] and [End_Date]). On the main form I have a field called DevAssgn. This is a text box that will display a Y or N (text value; this is not a true-false field). The control source for this field is also called DevAssgn.
I would like to have this field display a Y if an employee is on a current developmental assignment, regardless if any other assignment they have had in the past has expired.
Any ideas on how I might best accomplish this? Thank you in advance!
PS: Forgot to post the code I've tried to use.
Private Sub Form_Current()
Set the form Developmental Assignments to change the Dev Assgn box from Y to N if the Assignment
End_Date has expired.
If Forms![frm_DNO_Developmental Assignments]![sbfrmDevelopmentalAssignments]![End_Date] >= Date Then
Forms![frm_DNO_Developmental Assignments]![DevAssgn] = "Y"
Else Forms![frm_DNO_Developmental Assignments]![DevAssgn] = "N"
End If
End Sub
Last edited: