Hi there, am wondering if there is a way to have this code capture 2 dates. You see, I have several fields and some are REQUIRED fields and some are NON-REQUIRED fields. I am attempting to capture one date after the REQUIRED fields have been populated and totally different date for the NON-REQUIRED fields after they have been populated. It seems that I am getting one date being populated in both REQUIRED and NON-REQUIRED fields.
You see, sometimes it takes people several days to capture all the REQUIRED fields or all the NON-REQUIRED fields. Because of this, I need to be sure that I can capture the correct date for both fields.
Have any ideas on what I can do to correct this??? It would be greatly appreciated if you or someone can show me exactly what I need to do.
Thank you VERY much for your assistance.
[CODE=vb]
Private Sub Form_BeforeUpda te(Cancel As Integer)
Dim FLAG_2 As Integer
FLAG_2 = 0
If Not IsNull(Me.Commu nicated_Date) Then
FLAG_2 = FLAG_2 + 1
End If
If Not IsNull(Me.Descr ibeInjury) Then
FLAG_2 = FLAG_2 + 1
End If
If Not IsNull(Me.BODY_ PART_ID) Then
FLAG_2 = FLAG_2 + 1
End If
If Not IsNull(Me.F_MEA SURES!DATE_COMP L) Then
FLAG_2 = FLAG_2 + 1
End If
If Not IsNull(Me.F_SME _INVEST_TEAM!SM E_NAME) Then
FLAG_2 = FLAG_2 + 1
End If
If Not IsNull(Me.F_SME _INVEST_TEAM!SM E_TITLE) Then
FLAG_2 = FLAG_2 + 1
End If
If Not IsNull(Me.INV_T EAM_REVIEWED) Then
FLAG_2 = FLAG_2 + 1
End If
If FLAG_2 = 7 Then
Me.DATE_NOT_REQ = Now()
End If
Dim FLAG_3 As Integer
FLAG_3 = 0
If Not IsNull(Me.SRI) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.LOC_C ODE) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.COST_ CTR) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.INCID ENT_DATE) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.INCID ENT_TIME) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.WEEKD AY_CODE) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.SITE_ LOC_CODE) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.SITE_ AREA_CODE) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.DateR eported) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.TimeR eported) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.INCID ENT_TYPE_CODE) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.Incid entDescription) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.KNOWN _FACTS) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_IMM ED_FACTOR_B!IMM _FACTOR_ID) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_KEY _FACTORS!ID) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.Patie ntHandlingFacto r) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_MEA SURES!ACTION_ID ) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_MEA SURES!DESCRIPTI ON) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_MEA SURES!RESPONSIB LE_PARTY) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_MEA SURES!TARGET_CO MP_DATE) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_MEA SURES!RULE_PROC ) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_AUT HOR!AUTHOR_NAME ) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_AUT HOR!AUTHOR_TITL E) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.EMP_I NVEST_TEAM) Then
FLAG_3 = FLAG_3 + 1
End If
If IsNull(Me.DATE_ REQUIRED) Then
If FLAG_3 = 24 Then
Me.DATE_REQUIRE D = Now()
End If
End If
End Sub[/CODE]
You see, sometimes it takes people several days to capture all the REQUIRED fields or all the NON-REQUIRED fields. Because of this, I need to be sure that I can capture the correct date for both fields.
Have any ideas on what I can do to correct this??? It would be greatly appreciated if you or someone can show me exactly what I need to do.
Thank you VERY much for your assistance.
[CODE=vb]
Private Sub Form_BeforeUpda te(Cancel As Integer)
Dim FLAG_2 As Integer
FLAG_2 = 0
If Not IsNull(Me.Commu nicated_Date) Then
FLAG_2 = FLAG_2 + 1
End If
If Not IsNull(Me.Descr ibeInjury) Then
FLAG_2 = FLAG_2 + 1
End If
If Not IsNull(Me.BODY_ PART_ID) Then
FLAG_2 = FLAG_2 + 1
End If
If Not IsNull(Me.F_MEA SURES!DATE_COMP L) Then
FLAG_2 = FLAG_2 + 1
End If
If Not IsNull(Me.F_SME _INVEST_TEAM!SM E_NAME) Then
FLAG_2 = FLAG_2 + 1
End If
If Not IsNull(Me.F_SME _INVEST_TEAM!SM E_TITLE) Then
FLAG_2 = FLAG_2 + 1
End If
If Not IsNull(Me.INV_T EAM_REVIEWED) Then
FLAG_2 = FLAG_2 + 1
End If
If FLAG_2 = 7 Then
Me.DATE_NOT_REQ = Now()
End If
Dim FLAG_3 As Integer
FLAG_3 = 0
If Not IsNull(Me.SRI) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.LOC_C ODE) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.COST_ CTR) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.INCID ENT_DATE) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.INCID ENT_TIME) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.WEEKD AY_CODE) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.SITE_ LOC_CODE) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.SITE_ AREA_CODE) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.DateR eported) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.TimeR eported) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.INCID ENT_TYPE_CODE) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.Incid entDescription) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.KNOWN _FACTS) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_IMM ED_FACTOR_B!IMM _FACTOR_ID) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_KEY _FACTORS!ID) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.Patie ntHandlingFacto r) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_MEA SURES!ACTION_ID ) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_MEA SURES!DESCRIPTI ON) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_MEA SURES!RESPONSIB LE_PARTY) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_MEA SURES!TARGET_CO MP_DATE) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_MEA SURES!RULE_PROC ) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_AUT HOR!AUTHOR_NAME ) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.F_AUT HOR!AUTHOR_TITL E) Then
FLAG_3 = FLAG_3 + 1
End If
If Not IsNull(Me.EMP_I NVEST_TEAM) Then
FLAG_3 = FLAG_3 + 1
End If
If IsNull(Me.DATE_ REQUIRED) Then
If FLAG_3 = 24 Then
Me.DATE_REQUIRE D = Now()
End If
End If
End Sub[/CODE]
Comment