Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

listboxes - checking for dupplicates

Status
Not open for further replies.

cyrilf

Programmer
Jul 21, 1999
6
CA
Is there a quick way to check if a value already exists in a listbox other looping through the items in the listbox?

Thanks in advance
 
I don't believe so, although it does depend on the RecordSourceType. If this was an array, you could use ASCAN().

Rick
 
if it is from a alias you can try using select

_tally = 0
select field from alias where field = value into cursor junk
if _tally > 1
duplicate
endif

if your alias is buffered, uncommitted data then this will fail. select always makes hits on the underlying table. so if data is added to buffered table and no tableupdate is done on new records then this will fail.

if your source is an array, then use the ascan function to scan the array.


Attitude is Everything
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top