T
Ted
am using a2k in case it matters.
i was pretty convinced what i was wanting was to write this vba in the
AFterupdate event of the form's. what i'm trying to do is test if the user
has made any changes to the controls spelled out in the code and if so in at
least one of the instances i list then launch a macro which updates a table
with the updated value or values of the said controls. it doesn't appear to
be happening. in testing it with the breakpoints, i notice that if i, say,
change the value of 'Campus', allowing the other ones to remain as before,
and attempt to move to the next record, the value of Flag remains at 0.
i thought that the afterupdate event occurs after changed data to a control
or record is updated (to quote the pertinent documenation). how have i run
afoul of vba this time :-(
Private Sub Form_AfterUpdate()
Dim Flag As Integer
Flag = 0
Select Case Outcome_
Case 5, 6, 7
If Me.Last_Name <> Me.Last_Name.OldValue Then
Flag = Flag + 1
ElseIf Me.First_Name <> Me.First_Name.OldValue Then
Flag = Flag + 1
ElseIf Me.MR_Number <> Me.MR_Number.OldValue Then
Flag = Flag + 1
ElseIf Me.SequenceNum <> Me.SequenceNum.OldValue Then
Flag = Flag + 1
ElseIf Me.SponsorIDNumber <> Me.SponsorIDNumber.OldValue Then
Flag = Flag + 1
ElseIf Me.IRB_Number <> Me.IRB_Number.OldValue Then
Flag = Flag + 1
ElseIf Me.OffStudyDate <> Me.OffStudyDate.OldValue Then
Flag = Flag + 1
ElseIf Me.Campus <> Me.Campus.OldValue Then
Flag = Flag + 1
End If
Case Else
End Select
If Flag > 0 Then DoCmd.RunMacro "Update Screening Log (Edit Only) Record"
End Sub
i was pretty convinced what i was wanting was to write this vba in the
AFterupdate event of the form's. what i'm trying to do is test if the user
has made any changes to the controls spelled out in the code and if so in at
least one of the instances i list then launch a macro which updates a table
with the updated value or values of the said controls. it doesn't appear to
be happening. in testing it with the breakpoints, i notice that if i, say,
change the value of 'Campus', allowing the other ones to remain as before,
and attempt to move to the next record, the value of Flag remains at 0.
i thought that the afterupdate event occurs after changed data to a control
or record is updated (to quote the pertinent documenation). how have i run
afoul of vba this time :-(
Private Sub Form_AfterUpdate()
Dim Flag As Integer
Flag = 0
Select Case Outcome_
Case 5, 6, 7
If Me.Last_Name <> Me.Last_Name.OldValue Then
Flag = Flag + 1
ElseIf Me.First_Name <> Me.First_Name.OldValue Then
Flag = Flag + 1
ElseIf Me.MR_Number <> Me.MR_Number.OldValue Then
Flag = Flag + 1
ElseIf Me.SequenceNum <> Me.SequenceNum.OldValue Then
Flag = Flag + 1
ElseIf Me.SponsorIDNumber <> Me.SponsorIDNumber.OldValue Then
Flag = Flag + 1
ElseIf Me.IRB_Number <> Me.IRB_Number.OldValue Then
Flag = Flag + 1
ElseIf Me.OffStudyDate <> Me.OffStudyDate.OldValue Then
Flag = Flag + 1
ElseIf Me.Campus <> Me.Campus.OldValue Then
Flag = Flag + 1
End If
Case Else
End Select
If Flag > 0 Then DoCmd.RunMacro "Update Screening Log (Edit Only) Record"
End Sub