S
Sag73
Hi all,
A2K3/ SQL2K/ ADP
Got a form which is bound to a SP. The aim is to be able to search for
records based on either the ID or the person name. I have therefore made
these two controls invisible and added two unbound controls which get
updated from the invisible controls by the "On Current " event. The aim of
the unbound controls is to be able to type values therein and the "Before
Update" and "After Update" events fire the search which displays the
appropriate record in the form or shows a popup form to select "near
matches" (the name is searched using 'Like %search criteria%'). Before Event
validates data entry in the unbound controls beofre allowing After Event to
perform the search and display the record if a match is found.
Problem is, if no match is found or invalid data is entered, I try to use:
Private Sub txtName_BeforeUpdate(Cancel as Integer)
If (sinlge match found) Then
(display record data in Form)
elseif (multiple matches found) then
(display selection form)
(display selected record in form)
else
Cancel=True
Me.txtName.Undo
end if
in Before Update but no matter what, the entry is not being undone in the
control. Any help greatly appreciated.
A2K3/ SQL2K/ ADP
Got a form which is bound to a SP. The aim is to be able to search for
records based on either the ID or the person name. I have therefore made
these two controls invisible and added two unbound controls which get
updated from the invisible controls by the "On Current " event. The aim of
the unbound controls is to be able to type values therein and the "Before
Update" and "After Update" events fire the search which displays the
appropriate record in the form or shows a popup form to select "near
matches" (the name is searched using 'Like %search criteria%'). Before Event
validates data entry in the unbound controls beofre allowing After Event to
perform the search and display the record if a match is found.
Problem is, if no match is found or invalid data is entered, I try to use:
Private Sub txtName_BeforeUpdate(Cancel as Integer)
If (sinlge match found) Then
(display record data in Form)
elseif (multiple matches found) then
(display selection form)
(display selected record in form)
else
Cancel=True
Me.txtName.Undo
end if
in Before Update but no matter what, the entry is not being undone in the
control. Any help greatly appreciated.