jammin140900
Registered User.
- Local time
- Tomorrow, 02:09
- Joined
- Aug 18, 2008
- Messages
- 35
Hi there,
I have a datasheet subform with milestone items where users enter dates as each milestone passes and I'm setting up a automatic status box that continually updates as each milestone date get's entered.
I've got a few "IF" statesments to work this and it works perfectly when a user enters a date and moves away from the field, the status changes automatically. I also want it to be able to back-track in that, if for some reason the user accidently enters the date in the wrong milestone box and clears the field, I want the status to automatically revert back to the former status. Using the same theory, this doesn't work. I'm not sure if it's a refresh problem or something else?
Here's a copy of the code..
Private Sub DateReferredtoAuditor_BeforeUpdate(Cancel As Integer)
lngrecordnum = Forms![frmAuditing].CurrentRecord
End Sub
Private Sub DateReferredtoAuditor_AfterUpdate()
'**31/08/09 MF- Automation of Audit Status Function
If Me.DateReferredtoAuditor <> "" And Me.AuditStatusID = 1 Then
Me.AuditStatusID = 2
ElseIf Me.DateReferredtoAuditor = "" And Me.AuditStatusID = 2 Then
Me.AuditStatusID = 1
End If
Forms![frmAuditing].Requery
DoCmd.GoToRecord acDataForm, "frmAuditing", acGoTo, lngrecordnum
End Sub
Any ideas please? Don't know why the same theory doesn't work in the opposite direction! Thanks,Jammin
I have a datasheet subform with milestone items where users enter dates as each milestone passes and I'm setting up a automatic status box that continually updates as each milestone date get's entered.
I've got a few "IF" statesments to work this and it works perfectly when a user enters a date and moves away from the field, the status changes automatically. I also want it to be able to back-track in that, if for some reason the user accidently enters the date in the wrong milestone box and clears the field, I want the status to automatically revert back to the former status. Using the same theory, this doesn't work. I'm not sure if it's a refresh problem or something else?
Here's a copy of the code..
Private Sub DateReferredtoAuditor_BeforeUpdate(Cancel As Integer)
lngrecordnum = Forms![frmAuditing].CurrentRecord
End Sub
Private Sub DateReferredtoAuditor_AfterUpdate()
'**31/08/09 MF- Automation of Audit Status Function
If Me.DateReferredtoAuditor <> "" And Me.AuditStatusID = 1 Then
Me.AuditStatusID = 2
ElseIf Me.DateReferredtoAuditor = "" And Me.AuditStatusID = 2 Then
Me.AuditStatusID = 1
End If
Forms![frmAuditing].Requery
DoCmd.GoToRecord acDataForm, "frmAuditing", acGoTo, lngrecordnum
End Sub
Any ideas please? Don't know why the same theory doesn't work in the opposite direction! Thanks,Jammin