Simple Validation Process not so simple 
Author Message
 Simple Validation Process not so simple

I am an experience programmer (10 years+) and have been validating data with
no problem forever.  However, recently I ran into something that makes me
wonder how I ever was able to do it.

What is wrong with this picture ...

I have a textbox with a control source set to a field in the only table
assigned to the data environment.  I do not wish to have duplicate values in
that field of the table.  I do not use databases.  I use only free tables.
I am using tableUpdate() and tableRevert() functions and they seem to work
fine.

However ... I attempting to validate the uniqueness of the value for that
field I find that when I search (or seek) the table for the value the user
just entered ... just the process of moving off of the record I was on
during data entry causes the table to update and I can no longer utilize the
tableRevert() function to go back to what i had previous to the beginning of
the editing process.

Does this make any sense ??

I am a little bit stumped here.   Would appreciate some light on the
subject.  Thanks.



Sun, 18 Nov 2001 03:00:00 GMT  
 Simple Validation Process not so simple
The act of moving the record pointer automatically sends a TABLEUPDATE() by
design.

If you are using VFP 6.0 you have a wonderful alternative in INDEXSEEK() for
determining if a value is unique without moving the record pointer.

--Brad


Quote:
> I am an experience programmer (10 years+) and have been validating data
with
> no problem forever.  However, recently I ran into something that makes me
> wonder how I ever was able to do it.

> What is wrong with this picture ...

> I have a textbox with a control source set to a field in the only table
> assigned to the data environment.  I do not wish to have duplicate values
in
> that field of the table.  I do not use databases.  I use only free tables.
> I am using tableUpdate() and tableRevert() functions and they seem to work
> fine.

> However ... I attempting to validate the uniqueness of the value for that
> field I find that when I search (or seek) the table for the value the user
> just entered ... just the process of moving off of the record I was on
> during data entry causes the table to update and I can no longer utilize
the
> tableRevert() function to go back to what i had previous to the beginning
of
> the editing process.

> Does this make any sense ??

> I am a little bit stumped here.   Would appreciate some light on the
> subject.  Thanks.



Sun, 18 Nov 2001 03:00:00 GMT  
 Simple Validation Process not so simple
Open your table again with a different alias and do the seek in that new
alias.

USE oldtable AGAIN ALIAS newtable IN 0
IF SEEK(condition,'newtable','whatevertag')
  *
  * duplicate!
  *
ELSE
  *
  * OK
  *
ENDIF

This will not move the record pointer in your oldtable and will not force
the TableUpdate to write the changes.

Fred

Quote:

>I am an experience programmer (10 years+) and have been validating data
with
>no problem forever.  However, recently I ran into something that makes me
>wonder how I ever was able to do it.

>What is wrong with this picture ...

>I have a textbox with a control source set to a field in the only table
>assigned to the data environment.  I do not wish to have duplicate values
in
>that field of the table.  I do not use databases.  I use only free tables.
>I am using tableUpdate() and tableRevert() functions and they seem to work
>fine.

>However ... I attempting to validate the uniqueness of the value for that
>field I find that when I search (or seek) the table for the value the user
>just entered ... just the process of moving off of the record I was on
>during data entry causes the table to update and I can no longer utilize
the
>tableRevert() function to go back to what i had previous to the beginning
of
>the editing process.

>Does this make any sense ??

>I am a little bit stumped here.   Would appreciate some light on the
>subject.  Thanks.



Sun, 18 Nov 2001 03:00:00 GMT  
 Simple Validation Process not so simple
Hi Don,


Quote:
> However ... I attempting to validate the uniqueness of the value for that
> field I find that when I search (or seek) the table for the value the user
> just entered ... just the process of moving off of the record I was on
> during data entry causes the table to update and I can no longer utilize
the
> tableRevert() function to go back to what i had previous to the beginning
of
> the editing process.

> Does this make any sense ??

When you use Row Buffering a TableUpdate fires whenever you move the record
pointer. The workaround is to USE the Table AGAIN and perform your
validation checking in the other copy. Alternatively, switch to Table
Buffering.

Best regards,
Tom



Sun, 18 Nov 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. simple field validation

2. simple question needs a simple answer

3. Simple labels problem...Simple answer??

4. Help with Simple Data Entry Validation

5. VFP3 combobox not as simple as FP2.6

6. Really Simple VFP Question (But Not For Me)

7. Simple query not working

8. VFP 3.0b Simple Question - Simple Answer (I HOPE!)

9. Simple DropDown/Combo Object Question

10. Simple question from beginner

11. Plz answer me this simple foxpro question on hide

12. Simple Order By Question

 

 
Powered by phpBB® Forum Software