General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Checking if item already exists
I need to know if an item is in a table before updating the table
From the table bancos.dbf I have two cursors as below, buffered
pessismist (4)
SELECT BANCOS1
BROWSE
SELECT BANCOS
BROWSE
LOCATE FOR (UPPER(BANCO) = UPPER(THISFORM.TEXT1.Value)
IF FOUND ()
= MESSAGEBOX ("The record already exists")
RETU
endif
= MESSAGEBOX ("uptade")
SELECT bancos1
TABLEUPDATE()
THISFORM.Release
At the first time it works fine, because as in browse test
the new item only appear in bancos1 and not in bancos
The problem is that if the item already exists,
then it always will repeat "item already exists" even
if I type a completely differente item
It looks like it accour an inversion, because the item
is not shown in bancos1 but is shown in bancos
So, I have the false menssage that the item already exist
Moises
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only