[DUG] A better way of checking if duplicate exists

Jolyon Direnko-Smith jsmith at deltics.co.nz
Mon Mar 6 11:06:57 NZDT 2017


The pattern for this is usually something along the lines of:

DisableControls
Get bookmark
try
  First
  while not (duplicateFound or EOF) do
  begin
     duplicateFound := duplicate check(s)
     Next
  end

finally
  Restore bookmark
  EnableControls
end

hth

On 6 March 2017 at 10:46, Marshland Engineering <marshland at marshland.co.nz>
wrote:

> I have a form linked to a tbl. When I enter data into the form, there is
> one
> field that needs to be checked for duplicates.
>
> If I use a locate, I end up on the matching record and not on my current
> one.
>
> Basically I want to disable all tables and screen updates, do a search and
> if
> found, set a flag and in either case the return the to the original
> workspace.
>
> Any suggestions ?
>
> Thanks Wallace
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz with
> Subject: unsubscribe
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20170306/1b4e6054/attachment.html 


More information about the Delphi mailing list