Method or date member not found

G

Guest

using a2k, i am getting this 'Compile error'.

here's the vba code:

Private Sub Form_AfterUpdate()
If Me.Last_Name <> Me.Last_Name.OldValue Or Me.First_Name <>
Me.First_Name.OldValue Or _
Me.MR_Number <> Me.MR_Number.OldValue Or Me.SequenceNum <>
Me.SequenceNum.OldValue Or _
Me.IRB_Number <> Me.IRB_Number.OldValue Or Me.[Sponsor ID Nbr] <>
Me.[Sponsor ID Nbr].OldValue Or _
Me.OffStudyDate <> Me.OffStudyDate.OldValue Or Me.Campus <>
Me.Campus.OldValue And (Me.Outcome_ = 5 Or _
Me.Outcome_ = 6 Or Me.Outcome_ = 7) Then
DoCmd.RunMacro "Update Screening Log (Edit Only) Record"
End If
End Sub

i'm not totally new to this, however what strikes me as kind of odd is that
the variables as i call them following the 'Me' were all culled from the
lookup table which vba thoughtfully provided one i entered the dot ('.')
after the 'Me' word.

i've tried debugging this thing and rearranging the order of the data
elements to see if that made a difference and using the code above,
IRN_Number was highlighted in reverse video when the messae in the subject
got displayed.

using the same (but re-arranged) vba code below, it happens over the
Me.SequenceNum.

Private Sub Form_AfterUpdate()
If Me.Last_Name <> Me.Last_Name.OldValue Or Me.First_Name <>
Me.First_Name.OldValue Or _
Me.MR_Number <> Me.MR_Number.OldValue Or Me.SequenceNum <>
Me.SequenceNum.OldValue Or _
Me.[Sponsor ID Nbr] <> Me.[Sponsor ID Nbr].OldValue Or Me.IRB_Number <>
Me.IRB_Number.OldValue Or _
Me.OffStudyDate <> Me.OffStudyDate.OldValue Or Me.Campus <>
Me.Campus.OldValue And (Me.Outcome_ = 5 Or _
Me.Outcome_ = 6 Or Me.Outcome_ = 7) Then
DoCmd.RunMacro "Update Screening Log (Edit Only) Record"
End If
End Sub

can anybody explain what i'm doing rong?!
 
G

Guest

i'm going to answer my own question....upon further researching the controls'
names, it turned out that the one i had been calling Me.[Sponsor ID Nbr]
belongs the control source and not to the combo box in question which was
me.SponsorIDNumber. making that correction solved the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top