S
Surinder Kumar Arora ITS GM EAST MTNL Delhi
I want code in a form for update event for a field named telephone having
eight character number property to search for all records telephone field
and return no action if no record is having that value
and if any other record is having that value it should go to that
record(latest record if more than one records are having that value)
I have written the code as follows
It accepts duplicate values and does not go to the duplicate record
Private Sub TEL_AfterUpdate()
Dim rst As Object
Set rst = Me.RecordsetClone
rst.FindFirst "[Tel] = ' " & Me.TEL & " ' "
If rst.NoMatch Then
Me.COMPLAINT = COMPLAINT
Else
'immediately go to that record
Me.Bookmark = rst.Bookmark
End If
rst.Close
End Sub
regards
arora sk
eight character number property to search for all records telephone field
and return no action if no record is having that value
and if any other record is having that value it should go to that
record(latest record if more than one records are having that value)
I have written the code as follows
It accepts duplicate values and does not go to the duplicate record
Private Sub TEL_AfterUpdate()
Dim rst As Object
Set rst = Me.RecordsetClone
rst.FindFirst "[Tel] = ' " & Me.TEL & " ' "
If rst.NoMatch Then
Me.COMPLAINT = COMPLAINT
Else
'immediately go to that record
Me.Bookmark = rst.Bookmark
End If
rst.Close
End Sub
regards
arora sk