General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Missing informations. Is the textbox bounded to the field Banco in the cursor Bancos1 or Bancos? Is this a multi-user application? If so, your logic would not work in the case that 2 users enter the same value at the same time. Can you make the field a candidate key in the table instead? Or use a trigger?
>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
Previous
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